Skip to content

Commit 1776679

Browse files
committed
fix(snippets): multiple add to favorites
1 parent 4fb7b95 commit 1776679

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/renderer/components/snippets/SnippetListItem.vue

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,17 @@ const onClickContextMenu = async () => {
182182
}
183183
184184
if (action === 'favorites') {
185-
await snippetStore.patchSnippetsById(props.id, {
186-
isFavorites: data
187-
})
185+
if (snippetStore.selectedIds.length) {
186+
for (const id of snippetStore.selectedIds) {
187+
await snippetStore.patchSnippetsById(id, {
188+
isFavorites: data
189+
})
190+
}
191+
} else {
192+
await snippetStore.patchSnippetsById(props.id, {
193+
isFavorites: data
194+
})
195+
}
188196
189197
if (data) {
190198
track('snippets/add-to-favorites')

0 commit comments

Comments
 (0)