Skip to content

Commit

Permalink
feat(main): remove trash as folder from default
Browse files Browse the repository at this point in the history
  • Loading branch information
antonreshetov committed Apr 1, 2022
1 parent b5dcb73 commit 34c8287
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
11 changes: 0 additions & 11 deletions src/main/services/db/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,6 @@ const DEFAULT_SYSTEM_FOLDERS: Folder[] = [
isSystem: true,
createdAt: new Date().valueOf(),
updatedAt: new Date().valueOf()
},
{
id: nanoid(8),
name: 'Trash',
defaultLanguage: 'plain_text',
parentId: null,
index: 0,
isOpen: false,
isSystem: true,
createdAt: new Date().valueOf(),
updatedAt: new Date().valueOf()
}
]

Expand Down
10 changes: 5 additions & 5 deletions src/renderer/components/sidebar/TheSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,16 @@ const systemFolders = computed(() => {
const folders = folderStore.system.map<Partial<SidebarSystemFolder>>(i => {
let icon
if (i.name === 'Inbox') icon = Inbox
if (i.name === 'Trash') icon = Trash
return { ...i, icon }
})
const favAndAll = [
const other = [
{ name: 'Favorites', icon: Favorite },
{ name: 'All Snippets', icon: Archive }
{ name: 'All Snippets', icon: Archive },
{ name: 'Trash', icon: Trash }
]
folders.splice(1, 0, ...favAndAll)
folders.splice(1, 0, ...other)
return folders
})
Expand All @@ -96,7 +96,7 @@ const activeTab = ref<Tab>('library')
const onClickFolder = async (id: string) => {
folderStore.selectId(id)
await snippetStore.getSnippetsByFolderIds(folderStore.selectedIds as string[])
const firstSnippetId = snippetStore.snippets[0]?.id
const firstSnippetId = snippetStore.snippetsNonDeleted[0]?.id
snippetStore.getSnippetsById(firstSnippetId)
}
Expand Down

0 comments on commit 34c8287

Please sign in to comment.