mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 20:24:05 -06:00
Merge pull request #3919 from tgxworld/fix_double_notifications
FIX: Incorrect key when checking for primary tab.
This commit is contained in:
commit
3c3d7c03f0
@ -11,7 +11,8 @@ let lastAction = -1;
|
||||
const focusTrackerKey = "focus-tracker";
|
||||
const idleThresholdTime = 1000 * 10; // 10 seconds
|
||||
|
||||
const keyValueStore = new KeyValueStore("discourse_desktop_notifications_");
|
||||
const context = "discourse_desktop_notifications_";
|
||||
const keyValueStore = new KeyValueStore(context);
|
||||
|
||||
// Called from an initializer
|
||||
function init(messageBus) {
|
||||
@ -60,7 +61,7 @@ function setupNotifications() {
|
||||
window.addEventListener("storage", function(e) {
|
||||
// note: This event only fires when other tabs setItem()
|
||||
const key = e.key;
|
||||
if (key !== focusTrackerKey) {
|
||||
if (key !== `${context}${focusTrackerKey}`) {
|
||||
return true;
|
||||
}
|
||||
primaryTab = false;
|
||||
|
Loading…
Reference in New Issue
Block a user