@@ -4,28 +4,23 @@ import Tree from '@/components/sidebar/folders/Tree.vue'
44import LibraryItem from ' @/components/sidebar/library/Item.vue'
55import * as ContextMenu from ' @/components/ui/shadcn/context-menu'
66import {
7- initCodeSpace ,
87 useApp ,
98 useFolders ,
109 useResizeHandle ,
1110 useSnippets ,
1211} from ' @/composables'
1312import { LibraryFilter } from ' @/composables/types'
14- import { scrollToSnippetIndex } from ' @/composables/useSnippetScroller'
1513import { i18n , store } from ' @/electron'
16- import { scrollToElement } from ' @/utils'
1714import { Archive , Inbox , Plus , Star , Trash } from ' lucide-vue-next'
1815import { LAYOUT_DEFAULTS } from ' ~/main/store/constants'
1916
20- const { state, isAppLoading, isCodeSpaceInitialized, pendingCodeNavigation }
21- = useApp ()
17+ const { state } = useApp ()
2218const {
2319 getSnippets,
2420 selectFirstSnippet,
2521 emptyTrash,
2622 isRestoreStateBlocked,
2723 clearSearch,
28- displayedSnippets,
2924} = useSnippets ()
3025const {
3126 folders,
@@ -78,34 +73,6 @@ const libraryItems = [
7873 { id: LibraryFilter .Trash , name: i18n .t (' common.trash' ), icon: Trash },
7974]
8075
81- async function initApp() {
82- if (pendingCodeNavigation .value ) {
83- return
84- }
85-
86- if (isCodeSpaceInitialized .value ) {
87- isAppLoading .value = false
88- return
89- }
90-
91- isAppLoading .value = true
92- await initCodeSpace ()
93-
94- nextTick (() => {
95- scrollToElement (` [id="${state .folderId }"] ` )
96-
97- const index
98- = displayedSnippets .value ?.findIndex (s => s .id === state .snippetId ) ?? - 1
99- if (index >= 0 ) {
100- scrollToSnippetIndex (index )
101- }
102- })
103-
104- isAppLoading .value = false
105- }
106-
107- void initApp ()
108-
10976async function onFolderClick({
11077 id ,
11178 event ,
0 commit comments