Skip to content

Commit

Permalink
Merge pull request #180 from Dreamlinerm/master
Browse files Browse the repository at this point in the history
sync all store changes not just settings key
  • Loading branch information
mubaidr authored Jan 9, 2025
2 parents 47cfd7f + 761ed99 commit b1166cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/composables/useBrowserStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function useBrowserSyncStorage<T>(key: string, defaultValue: T) {
chrome.storage.sync.onChanged.addListener(function (changes) {
if (changes?.[key]) {
isUpdatingFromStorage = true
const { oldValue, newValue } = changes.settings
const { oldValue, newValue } = changes[key]
data.value = newValue
setTimeout(() => {
isUpdatingFromStorage = false
Expand Down Expand Up @@ -100,7 +100,7 @@ export function useBrowserLocalStorage<T>(key: string, defaultValue: T) {
chrome.storage.local.onChanged.addListener(function (changes) {
if (changes?.[key]) {
isUpdatingFromStorage = true
const { oldValue, newValue } = changes.settings
const { oldValue, newValue } = changes[key]
data.value = newValue
setTimeout(() => {
isUpdatingFromStorage = false
Expand Down

0 comments on commit b1166cd

Please # to comment.