Skip to content

Commit 3787312

Browse files
committed
clear decorations when discussions.decorations.inline is false
1 parent 5fcc1e1 commit 3787312

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/extension.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ export function activate(): void {
1616
if (!editor) {
1717
return
1818
}
19+
const settings = resolveSettings(sourcegraph.configuration.get<Settings>().value)
20+
if (!settings['discussions.decorations.inline']) {
21+
editor.setDecorations(decorationType, []) // clear decorations
22+
return
23+
}
1924

2025
const uri = resolveURI(editor.document.uri)
2126

@@ -28,11 +33,6 @@ export function activate(): void {
2833

2934
const decorations: sourcegraph.TextDocumentDecoration[] = []
3035
for (const thread of threads.nodes) {
31-
const settings = resolveSettings(sourcegraph.configuration.get<Settings>().value)
32-
if (!settings['discussions.decorations.inline']) {
33-
return
34-
}
35-
3636
if (thread.target.__typename !== 'DiscussionThreadTargetRepo') {
3737
return
3838
}

0 commit comments

Comments
 (0)