Skip to content

Commit

Permalink
fix: should watch settings even if skipWrites is true
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Sep 18, 2024
1 parent dec80b5 commit b08ebcd
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions packages/core/src/instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,14 @@ export async function createMoquerieInstance(options: CreateMoquerieInstanceOpti
},
}

if (data.watching) {
// Watch settings
const unwatchSettings = onSettingsChange((settings) => {
if (settings.currentBranch && settings.currentBranch !== resourceStorages.currentBranch) {
applySwitchToBranch(mq, settings.currentBranch)
}
})
onDestroy(unwatchSettings)
}
// Watch settings
// should always watch even if skipWrites is true
const unwatchSettings = onSettingsChange((settings) => {
if (settings.currentBranch && settings.currentBranch !== resourceStorages.currentBranch) {
applySwitchToBranch(mq, settings.currentBranch)
}
})
onDestroy(unwatchSettings)

async function destroy() {
for (const cb of data.onInstanceDestroyCallbacks) {
Expand Down

0 comments on commit b08ebcd

Please sign in to comment.