Skip to content

Commit

Permalink
stop listening for live settings update
Browse files Browse the repository at this point in the history
  • Loading branch information
yash-rajpal committed Aug 22, 2024
1 parent 10baefd commit d050713
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/meteor/client/startup/accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ Accounts.onEmailVerificationLink((token: string) => {
});

Meteor.startup(() => {
Tracker.autorun(() => {
Tracker.autorun((computation) => {
const forgetUserSessionOnWindowClose = settings.get('Accounts_ForgetUserSessionOnWindowClose');

if (forgetUserSessionOnWindowClose === undefined) {
return;
}

computation.stop();

Accounts.config({ clientStorage: forgetUserSessionOnWindowClose ? 'session' : 'local' });
});
});

0 comments on commit d050713

Please sign in to comment.