We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ce8e55b commit 692bbdaCopy full SHA for 692bbda
packages/docusaurus-theme-common/src/utils/storageUtils.ts
@@ -31,6 +31,13 @@ function dispatchChangeEvent({
31
newValue: string | null;
32
storage: Storage;
33
}) {
34
+ // If we set multiple times the same storage value, events should not be fired
35
+ // The native events behave this way, so our manual event dispatch should
36
+ // rather behave exactly the same. Not doing so might create infinite loops.
37
+ // See https://github.com/facebook/docusaurus/issues/8594
38
+ if (oldValue === newValue) {
39
+ return;
40
+ }
41
const event = document.createEvent('StorageEvent');
42
event.initStorageEvent(
43
'storage',
0 commit comments