diff --git a/app/assets/javascripts/discourse/app/components/user-status-message.js b/app/assets/javascripts/discourse/app/components/user-status-message.js index e7b74052774..18934c14907 100644 --- a/app/assets/javascripts/discourse/app/components/user-status-message.js +++ b/app/assets/javascripts/discourse/app/components/user-status-message.js @@ -13,7 +13,7 @@ export default class UserStatusMessage extends Component { } const timezone = this.currentUser - ? this.currentUser.timezone + ? this.currentUser.user_option?.timezone : moment.tz.guess(); return until(this.status.ends_at, timezone, this.currentUser?.locale); diff --git a/app/assets/javascripts/discourse/app/controllers/preferences/interface.js b/app/assets/javascripts/discourse/app/controllers/preferences/interface.js index 92c3d46c03b..d022aec535c 100644 --- a/app/assets/javascripts/discourse/app/controllers/preferences/interface.js +++ b/app/assets/javascripts/discourse/app/controllers/preferences/interface.js @@ -434,8 +434,6 @@ export default Controller.extend({ }, resetSeenUserTips() { - this.model.set("skip_new_user_tips", false); - this.model.set("seen_popups", null); this.model.set("user_option.skip_new_user_tips", false); this.model.set("user_option.seen_popups", null); return this.model.save(["skip_new_user_tips", "seen_popups"]); diff --git a/app/assets/javascripts/discourse/app/models/user.js b/app/assets/javascripts/discourse/app/models/user.js index a722e8203c0..db53e68c53d 100644 --- a/app/assets/javascripts/discourse/app/models/user.js +++ b/app/assets/javascripts/discourse/app/models/user.js @@ -1179,7 +1179,7 @@ const User = RestModel.extend({ showUserTip(options) { const userTips = Site.currentProp("user_tips"); - if (!userTips || this.skip_new_user_tips) { + if (!userTips || this.user_option?.skip_new_user_tips) { return; } @@ -1191,7 +1191,7 @@ const User = RestModel.extend({ return; } - const seenUserTips = this.seen_popups || []; + const seenUserTips = this.user_option?.seen_popups || []; if ( seenUserTips.includes(-1) || seenUserTips.includes(userTips[options.id]) @@ -1208,7 +1208,7 @@ const User = RestModel.extend({ hideUserTipForever(userTipId) { const userTips = Site.currentProp("user_tips"); - if (!userTips || this.skip_new_user_tips) { + if (!userTips || this.user_option?.skip_new_user_tips) { return; } @@ -1228,7 +1228,7 @@ const User = RestModel.extend({ } // Update list of seen user tips. - let seenUserTips = this.seen_popups || []; + let seenUserTips = this.user_option?.seen_popups || []; if (userTipId) { if (seenUserTips.includes(userTips[userTipId])) { return; diff --git a/app/assets/javascripts/discourse/tests/acceptance/mobile-topic-bulk-actions-test.js b/app/assets/javascripts/discourse/tests/acceptance/mobile-topic-bulk-actions-test.js index 82cb0a21189..6647ad6448e 100644 --- a/app/assets/javascripts/discourse/tests/acceptance/mobile-topic-bulk-actions-test.js +++ b/app/assets/javascripts/discourse/tests/acceptance/mobile-topic-bulk-actions-test.js @@ -23,7 +23,7 @@ acceptance("Topic - Bulk Actions - Mobile", function (needs) { }); test("bulk select - modal", async function (assert) { - updateCurrentUser({ moderator: true, enable_defer: true }); + updateCurrentUser({ moderator: true, user_option: { enable_defer: true } }); await visit("/latest"); await click("button.bulk-select"); diff --git a/app/assets/javascripts/discourse/tests/acceptance/user-card-test.js b/app/assets/javascripts/discourse/tests/acceptance/user-card-test.js index 43904e65b7b..d7c08f30b00 100644 --- a/app/assets/javascripts/discourse/tests/acceptance/user-card-test.js +++ b/app/assets/javascripts/discourse/tests/acceptance/user-card-test.js @@ -14,7 +14,7 @@ acceptance("User Card - Show Local Time", function (needs) { needs.settings({ display_local_time_in_user_card: true }); test("user card local time - does not update timezone for another user", async function (assert) { - User.current().timezone = "Australia/Brisbane"; + User.current().user_option.timezone = "Australia/Brisbane"; await visit("/t/internationalization-localization/280"); await click('a[data-user-card="charlie"]'); diff --git a/app/assets/javascripts/discourse/tests/acceptance/user-status-test.js b/app/assets/javascripts/discourse/tests/acceptance/user-status-test.js index 13cf56be2f4..010a2cd4509 100644 --- a/app/assets/javascripts/discourse/tests/acceptance/user-status-test.js +++ b/app/assets/javascripts/discourse/tests/acceptance/user-status-test.js @@ -482,7 +482,7 @@ acceptance("User Status - new user menu", function (needs) { needs.user({ id: userId, - timezone: userTimezone, + "user_option.timezone": userTimezone, redesigned_user_menu_enabled: true, }); diff --git a/app/assets/javascripts/discourse/tests/fixtures/user-fixtures.js b/app/assets/javascripts/discourse/tests/fixtures/user-fixtures.js index 979543af5d9..464b039152e 100644 --- a/app/assets/javascripts/discourse/tests/fixtures/user-fixtures.js +++ b/app/assets/javascripts/discourse/tests/fixtures/user-fixtures.js @@ -3118,8 +3118,8 @@ export default { text_size: "normal", text_size_seq: 0, title_count_mode: "notifications", + timezone: "Asia/Tokyo", }, - timezone: "Asia/Tokyo", }, }, "/u/%E3%83%A9%E3%82%A4%E3%82%AA%E3%83%B3/summary.json": { diff --git a/app/assets/javascripts/discourse/tests/integration/components/select-kit/topic-notifications-button-test.js b/app/assets/javascripts/discourse/tests/integration/components/select-kit/topic-notifications-button-test.js index d605269d556..452aa104590 100644 --- a/app/assets/javascripts/discourse/tests/integration/components/select-kit/topic-notifications-button-test.js +++ b/app/assets/javascripts/discourse/tests/integration/components/select-kit/topic-notifications-button-test.js @@ -85,7 +85,7 @@ module( }); test("notification reason text - user mailing list mode", async function (assert) { - this.currentUser.set("mailing_list_mode", true); + this.currentUser.set("user_option.mailing_list_mode", true); this.set("topic", buildTopic.call(this, { level: 2 })); await render(hbs`