Skip to content

Commit 4fb7b95

Browse files
committed
fix(snippets): deselect after context menu action
1 parent 7e78922 commit 4fb7b95

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/renderer/components/snippets/SnippetListItem.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ const onClickContextMenu = async () => {
182182
}
183183
184184
if (action === 'favorites') {
185-
snippetStore.patchSnippetsById(props.id, {
185+
await snippetStore.patchSnippetsById(props.id, {
186186
isFavorites: data
187187
})
188188
@@ -192,21 +192,21 @@ const onClickContextMenu = async () => {
192192
track('snippets/delete-from-favorites')
193193
}
194194
195-
if (type === 'folder') {
196-
await snippetStore.getSnippetsByFolderIds(folderStore.selectedIds!)
197-
}
195+
await snippetStore.getSnippets()
198196
199197
if (type === 'favorites') {
200-
await snippetStore.getSnippets()
201198
snippetStore.setSnippetsByAlias(type)
202199
}
203200
}
204201
205202
isHighlighted.value = false
206203
isFocused.value = false
207204
snippetStore.isContextState = false
208-
snippetStore.selected = undefined
209-
snippetStore.selectedMultiple = []
205+
206+
if (snippetStore.selectedIds.length) {
207+
snippetStore.selected = undefined
208+
snippetStore.selectedMultiple = []
209+
}
210210
}
211211
212212
const dateFormat = computed(() => {

0 commit comments

Comments
 (0)