Skip to content

Commit

Permalink
Merge pull request #184 from vircadia/fix/localstorage-conflicts
Browse files Browse the repository at this point in the history
Only sync bookmarks & control settings between tabs.
  • Loading branch information
digisomni authored Sep 22, 2023
2 parents 13b6101 + 5c56673 commit b437531
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/stores/user-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const useUserStore = defineStore("user", {
activeModel: defaultActiveAvatarId()
},
persistentStorageMedium,
{ mergeDefaults: true }
{ mergeDefaults: true, listenToStorageChanges: false }
),
// Graphics configuration.
graphics: useStorage(
Expand All @@ -103,7 +103,7 @@ export const useUserStore = defineStore("user", {
cameraBobbing: true
},
persistentStorageMedium,
{ mergeDefaults: true }
{ mergeDefaults: true, listenToStorageChanges: false }
),
// Information about the logged in account. Refer to Account module.
account: useStorage(
Expand All @@ -124,7 +124,7 @@ export const useUserStore = defineStore("user", {
}
},
persistentStorageMedium,
{ mergeDefaults: true }
{ mergeDefaults: true, listenToStorageChanges: false }
),
// Saved bookmarks.
bookmarks: useStorage(
Expand All @@ -133,10 +133,14 @@ export const useUserStore = defineStore("user", {
locations: [] as Array<LocationBookmark>
},
persistentStorageMedium,
{ mergeDefaults: true }
{ mergeDefaults: true, listenToStorageChanges: true }
),
// Controls.
controls: useStorage("userControlSettings", defaultControls, persistentStorageMedium, { mergeDefaults: true })
controls: useStorage("userControlSettings",
defaultControls,
persistentStorageMedium,
{ mergeDefaults: true, listenToStorageChanges: true }
)
}),

actions: {
Expand Down

0 comments on commit b437531

Please sign in to comment.