1
0
mirror of https://github.com/flarum/core.git synced 2025-08-04 15:37:51 +02:00

forum: do not update lastSeenAt when modifying discloseOnline preference

This value is immediately set in the backend again, so apart from causing visual glitches, it is useless as the preference doesn't prevent admins from seeing your last seen at time
This commit is contained in:
David Sevilla Martin
2020-02-01 09:05:16 -05:00
parent f22f4c02e6
commit f75c2cfc9c
3 changed files with 4 additions and 7 deletions

View File

@@ -1,8 +1,8 @@
import Button, { ButtonProps } from './Button';
interface LinkButtonProps extends ButtonProps {
active: boolean;
oncreate: Function;
active?: boolean;
oncreate?: Function;
href?: string;
}

View File

@@ -101,7 +101,7 @@ export default class User extends Model {
/**
* Update the user's preferences.
*/
savePreferences(newPreferences: object): Promise<User> {
savePreferences(newPreferences: UserPreferences): Promise<User> {
const preferences = this.preferences();
Object.assign(preferences, newPreferences);

View File

@@ -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),
})
);