Skip to content

Commit

Permalink
fix(snippets): multiple add to favorites
Browse files Browse the repository at this point in the history
  • Loading branch information
antonreshetov committed May 6, 2022
1 parent 4fb7b95 commit 1776679
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/renderer/components/snippets/SnippetListItem.vue
Expand Up @@ -182,9 +182,17 @@ const onClickContextMenu = async () => {
}
if (action === 'favorites') {
await snippetStore.patchSnippetsById(props.id, {
isFavorites: data
})
if (snippetStore.selectedIds.length) {
for (const id of snippetStore.selectedIds) {
await snippetStore.patchSnippetsById(id, {
isFavorites: data
})
}
} else {
await snippetStore.patchSnippetsById(props.id, {
isFavorites: data
})
}
if (data) {
track('snippets/add-to-favorites')
Expand Down

0 comments on commit 1776679

Please sign in to comment.