fix round tab reload on pref change - closes #4952

more-scalatags
Thibault Duplessis 2019-04-08 07:33:50 +07:00
parent 0058082b0d
commit 7a99b00848
3 changed files with 3 additions and 11 deletions

View File

@ -15,7 +15,7 @@ $(function() {
data: $form.serialize(),
success: function() {
$form.find('.saved').fadeIn();
lichess.reloadOtherTabs();
lichess.storage.set('reload-round-tabs', Math.random());
}
});
});

View File

@ -89,4 +89,6 @@ export default function(opts: RoundOpts): void {
history.replaceState(null, '', '/' + data.game.id);
if (!data.player.spectator && data.game.status.id < 25) li.topMenuIntent();
$('#zentog').click(li.pubsub.emit('zen'));
li.storage.make('reload-round-tabs').listen(li.reload);
}

View File

@ -65,17 +65,7 @@ function buildStorage(storageKey) {
};
lichess.storage = buildStorage('localStorage');
lichess.tempStorage = buildStorage('sessionStorage');
lichess.reloadOtherTabs = (function() {
var storage = lichess.storage.make('reload-other-tabs');
storage.listen(function() {
lichess.reload();
});
return function() {
storage.set(1);
}
})();
lichess.once = function(key, mod) {
if (mod === 'always') return true;
if (!lichess.storage.get(key)) {