Skip to content

Commit

Permalink
feat: 🎸 add clear menu for sidebar (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
bingryan authored Jun 18, 2023
1 parent 78bf059 commit 2441253
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/locales/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default {
common: {
edit: 'Edit',
delete: 'Delete',
clear: 'Clear',
copy: 'Copy',
copyQA: 'CopyQA',
newChat: 'New Chat',
Expand Down
1 change: 1 addition & 0 deletions src/locales/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default {
common: {
edit: '编辑',
delete: '删除',
clear: '清理',
copy: '复制',
copyQA: '复制QA',
newChat: '新建聊天',
Expand Down
11 changes: 11 additions & 0 deletions src/views/siderbar/List.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@
});
}
async function clearSelect(id: number) {
await chatStore.clearCache(id);
}
const contextMenuTheme = computed(() => {
return appStore.theme === 'dark' ? 'mac dark' : 'mac';
});
Expand All @@ -98,6 +102,13 @@
}),
onClick: () => editSelect(id),
},
{
label: t('common.clear'),
icon: h('i', {
class: 'fa-solid fa-broom',
}),
onClick: () => clearSelect(id),
},
],
zIndex: 60,
minWidth: 100,
Expand Down

0 comments on commit 2441253

Please sign in to comment.