A platform for community discussion. Free, open, simple.
FIX: Rewind: replace currentUser with user (#36742)
Kris705f47f5d61a
diff --git a/plugins/discourse-rewind/assets/javascripts/discourse/components/reports/ai-usage.gjs b/plugins/discourse-rewind/assets/javascripts/discourse/components/reports/ai-usage.gjsindex 0a8143a0d62..d80269d7035 100644--- a/plugins/discourse-rewind/assets/javascripts/discourse/components/reports/ai-usage.gjs+++ b/plugins/discourse-rewind/assets/javascripts/discourse/components/reports/ai-usage.gjs@@ -3,13 +3,10 @@ import { get } from "@ember/helper";import { action } from "@ember/object";import didInsert from "@ember/render-modifiers/modifiers/did-insert";import willDestroy from "@ember/render-modifiers/modifiers/will-destroy";-import { service } from "@ember/service";import number from "discourse/helpers/number";import { i18n } from "discourse-i18n";export default class AiUsage extends Component {- @service currentUser;-matrixInterval = null;get totalRequests() {@@ -114,7 +111,7 @@ export default class AiUsage extends Component {<div class="matrix-subhead">{{i18n"discourse_rewind.reports.ai_usage.wake_up"- username=this.currentUser.username}}</div>{{i18n "discourse_rewind.reports.ai_usage.system_title"}}diff --git a/plugins/discourse-rewind/assets/javascripts/discourse/components/reports/chat-usage.gjs b/plugins/discourse-rewind/assets/javascripts/discourse/components/reports/chat-usage.gjsindex bb2a4cef988..427b8cfc9e8 100644--- a/plugins/discourse-rewind/assets/javascripts/discourse/components/reports/chat-usage.gjs+++ b/plugins/discourse-rewind/assets/javascripts/discourse/components/reports/chat-usage.gjs@@ -1,6 +1,5 @@import Component from "@glimmer/component";import { concat } from "@ember/helper";-import { service } from "@ember/service";import { htmlSafe } from "@ember/template";import avatar from "discourse/helpers/avatar";import number from "discourse/helpers/number";@@ -40,8 +39,6 @@ const UserMessage = <template></template>;export default class ChatUsage extends Component {- @service currentUser;-get favoriteChannels() {return this.args.report.data.favorite_channels ?? [];}@@ -82,7 +79,7 @@ export default class ChatUsage extends Component {</div><div class="chat-message --right">- <UserMessage @user={{this.currentUser}} @replyKey="reply_1" />+ <UserMessage @user={{@user}} @replyKey="reply_1" /></div><div class="chat-message --left">@@ -98,7 +95,7 @@ export default class ChatUsage extends Component {</div><div class="chat-message --right">- <UserMessage @user={{this.currentUser}} @replyKey="reply_2" />+ <UserMessage @user={{@user}} @replyKey="reply_2" /></div><div class="chat-message --left">@@ -113,7 +110,7 @@ export default class ChatUsage extends Component {</div><div class="chat-message --right">- <UserMessage @user={{this.currentUser}} @replyKey="reply_3" />+ <UserMessage @user={{@user}} @replyKey="reply_3" /></div><div class="chat-message --left">@@ -154,7 +151,7 @@ export default class ChatUsage extends Component {{{/if}}<div class="chat-message --right">- <UserMessage @user={{this.currentUser}}>+ <UserMessage @user={{@user}}><imgsrc={{getURL"/plugins/discourse-rewind/images/dancing_baby.gif"diff --git a/plugins/discourse-rewind/assets/javascripts/discourse/components/reports/time-of-day-activity.gjs b/plugins/discourse-rewind/assets/javascripts/discourse/components/reports/time-of-day-activity.gjsindex 67807ebe7a1..35b1c16c043 100644--- a/plugins/discourse-rewind/assets/javascripts/discourse/components/reports/time-of-day-activity.gjs+++ b/plugins/discourse-rewind/assets/javascripts/discourse/components/reports/time-of-day-activity.gjs@@ -1,14 +1,11 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";import { action } from "@ember/object";-import { service } from "@ember/service";import { htmlSafe } from "@ember/template";import DButton from "discourse/components/d-button";import { i18n } from "discourse-i18n";export default class TimeOfDayActivity extends Component {- @service currentUser;-@tracked isPlaying = false;@tracked playbackProgress = 0;@tracked isGlitching = false;@@ -57,7 +54,7 @@ export default class TimeOfDayActivity extends Component {}get personalizedAudioParams() {- const username = this.currentUser?.username || "default";+ const username = this.args.user?.username || "default";// convert username to seedconst hash = (str) => {diff --git a/plugins/discourse-rewind/assets/javascripts/discourse/components/rewind.gjs b/plugins/discourse-rewind/assets/javascripts/discourse/components/rewind.gjsindex ccb005f06bd..5f1c9722edc 100644--- a/plugins/discourse-rewind/assets/javascripts/discourse/components/rewind.gjs+++ b/plugins/discourse-rewind/assets/javascripts/discourse/components/rewind.gjs@@ -164,7 +164,7 @@ export default class Rewind extends Component {@actionasync copyRewindLink() {await clipboardCopy(- getAbsoluteURL(`/u/${this.currentUser.username}/activity/rewind`)+ getAbsoluteURL(`/u/${this.args.user.username}/activity/rewind`));this.toasts.success({duration: "short",@@ -376,7 +376,7 @@ export default class Rewind extends Component {}}{{#if ReportComponent}}<div class={{concatClass "rewind-report" report.identifier}}>- <ReportComponent @report={{report}} />+ <ReportComponent @report={{report}} @user={{@user}} /></div>{{/if}}{{/let}}