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:
@@ -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),
|
||||
})
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user