mirror of
https://github.com/flarum/framework.git
synced 2025-03-15 00:05:12 +08: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:
parent
f22f4c02e6
commit
f75c2cfc9c
@ -1,8 +1,8 @@
|
||||
import Button, { ButtonProps } from './Button';
|
||||
|
||||
interface LinkButtonProps extends ButtonProps {
|
||||
active: boolean;
|
||||
oncreate: Function;
|
||||
active?: boolean;
|
||||
oncreate?: Function;
|
||||
href?: string;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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),
|
||||
})
|
||||
);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user