Skip to content

Commit b47fe6c

Browse files
committed
fix(extension): do not update if not changed
1 parent a5f3c58 commit b47fe6c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

extension/src/fetch.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,16 @@ export async function fetchLatest() {
2525
}
2626

2727
export async function fetchAndUpdate(ctx: ExtensionContext, prompt = true) {
28+
const config = workspace.getConfiguration()
2829
const patterns = await fetchLatest()
2930
let shouldUpdate = true
3031

32+
const oringalPatterns = { ...(config.get<object>('explorer.fileNesting.patterns') || {}) }
33+
delete oringalPatterns['//']
34+
// no change
35+
if (Object.keys(oringalPatterns).length > 0 && JSON.stringify(patterns) === JSON.stringify(oringalPatterns))
36+
return false
37+
3138
if (prompt) {
3239
const buttonUpdate = 'Update'
3340
const buttonSkip = 'Skip this time'
@@ -40,8 +47,6 @@ export async function fetchAndUpdate(ctx: ExtensionContext, prompt = true) {
4047
}
4148

4249
if (shouldUpdate) {
43-
const config = workspace.getConfiguration()
44-
4550
if (config.inspect('explorer.fileNesting.enabled')?.globalValue == null)
4651
config.update('explorer.fileNesting.enabled', true, true)
4752

0 commit comments

Comments
 (0)