Skip to content

Commit 7611361

Browse files
committed
Restrict persistence of checked context items files and websites to workspace state only
1 parent 3938dae commit 7611361

2 files changed

Lines changed: 2 additions & 20 deletions

File tree

‎packages/vscode/src/context/providers/websites-provider.ts‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -162,21 +162,12 @@ export class WebsitesProvider
162162
CONTEXT_CHECKED_URLS_STATE_KEY,
163163
checked_urls
164164
)
165-
await this.context.globalState.update(
166-
CONTEXT_CHECKED_URLS_STATE_KEY,
167-
checked_urls
168-
)
169165
}
170166

171167
public load_checked_websites_state(): void {
172-
let checked_urls = this.context.workspaceState.get<string[]>(
168+
const checked_urls = this.context.workspaceState.get<string[]>(
173169
CONTEXT_CHECKED_URLS_STATE_KEY
174170
)
175-
if (!checked_urls) {
176-
checked_urls = this.context.globalState.get<string[]>(
177-
CONTEXT_CHECKED_URLS_STATE_KEY
178-
)
179-
}
180171
if (checked_urls) {
181172
for (const url of checked_urls) {
182173
this._checked_websites.set(url, vscode.TreeItemCheckboxState.Checked)

‎packages/vscode/src/context/providers/workspace-provider.ts‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,21 +88,12 @@ export class WorkspaceProvider
8888
CONTEXT_CHECKED_PATHS_STATE_KEY,
8989
checked_paths
9090
)
91-
await this.context.globalState.update(
92-
CONTEXT_CHECKED_PATHS_STATE_KEY,
93-
checked_paths
94-
)
9591
}
9692

9793
public load_checked_files_state(): void {
98-
let persisted_checked_paths = this.context.workspaceState.get<string[]>(
94+
const persisted_checked_paths = this.context.workspaceState.get<string[]>(
9995
CONTEXT_CHECKED_PATHS_STATE_KEY
10096
)
101-
if (!persisted_checked_paths) {
102-
persisted_checked_paths = this.context.globalState.get<string[]>(
103-
CONTEXT_CHECKED_PATHS_STATE_KEY
104-
)
105-
}
10697
if (persisted_checked_paths && persisted_checked_paths.length > 0) {
10798
this.set_checked_files(persisted_checked_paths)
10899
}

0 commit comments

Comments
 (0)