fix round tab reload on pref change - closes #4952
parent
0058082b0d
commit
7a99b00848
|
@ -15,7 +15,7 @@ $(function() {
|
|||
data: $form.serialize(),
|
||||
success: function() {
|
||||
$form.find('.saved').fadeIn();
|
||||
lichess.reloadOtherTabs();
|
||||
lichess.storage.set('reload-round-tabs', Math.random());
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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)) {
|
||||
|
|
Loading…
Reference in New Issue