diff --git a/js/src/common/components/LinkButton.tsx b/js/src/common/components/LinkButton.tsx index e4cdc02e8..e220caaa9 100644 --- a/js/src/common/components/LinkButton.tsx +++ b/js/src/common/components/LinkButton.tsx @@ -1,8 +1,8 @@ import Button, { ButtonProps } from './Button'; interface LinkButtonProps extends ButtonProps { - active: boolean; - oncreate: Function; + active?: boolean; + oncreate?: Function; href?: string; } diff --git a/js/src/common/models/User.ts b/js/src/common/models/User.ts index 302f0dd3a..8b548db90 100644 --- a/js/src/common/models/User.ts +++ b/js/src/common/models/User.ts @@ -101,7 +101,7 @@ export default class User extends Model { /** * Update the user's preferences. */ - savePreferences(newPreferences: object): Promise { + savePreferences(newPreferences: UserPreferences): Promise { const preferences = this.preferences(); Object.assign(preferences, newPreferences); diff --git a/js/src/forum/components/SettingsPage.tsx b/js/src/forum/components/SettingsPage.tsx index 159e7dbf1..fdda0b95e 100644 --- a/js/src/forum/components/SettingsPage.tsx +++ b/js/src/forum/components/SettingsPage.tsx @@ -122,10 +122,7 @@ export default class SettingsPage extends UserPage { Switch.component({ children: app.translator.trans('core.forum.settings.privacy_disclose_online_label'), state: this.user.preferences().discloseOnline, - onchange: (value, component) => { - this.user.pushAttributes({ lastSeenAt: null }); - this.preferenceSaver('discloseOnline')(value, component); - }, + onchange: (value, component) => this.preferenceSaver('discloseOnline')(value, component), }) );