@@ -12,6 +12,7 @@ import { InboxView } from './InboxView'
1212import { TagSidebar } from './TagSidebar'
1313import { FilterBar } from './FilterBar'
1414import { SelectionActionBar } from './SelectionActionBar'
15+ import { WelcomeState } from './WelcomeState'
1516import { SettingsView } from '../ui/SettingsView'
1617import { HelpModal } from '../ui/HelpModal'
1718import { QuickTagModal } from '../ui/QuickTagModal'
@@ -23,12 +24,26 @@ import {
2324 bulkDeleteBookmarks ,
2425 toggleReadLater ,
2526} from '../../services/bookmarks'
27+ import { checkDeviceInitialization } from '../../services/key-storage'
2628
2729export function BookmarkList ( ) {
2830 const { bookmarks : bookmarksMap , synced } = useYjs ( )
2931 const [ bookmarks , setBookmarks ] = useState ( [ ] )
3032 const { toasts, addToast, removeToast } = useToast ( )
3133 const [ currentView , setCurrentView ] = useState ( 'bookmarks' )
34+ const [ isFirstRun , setIsFirstRun ] = useState ( false )
35+
36+ useEffect ( ( ) => {
37+ checkDeviceInitialization ( ) . then ( ( { hasLEK } ) => {
38+ setIsFirstRun ( ! hasLEK )
39+ } )
40+ } , [ ] )
41+
42+ useEffect ( ( ) => {
43+ if ( bookmarks . length > 0 ) {
44+ setIsFirstRun ( false )
45+ }
46+ } , [ bookmarks . length ] )
3247
3348 useEffect ( ( ) => {
3449 const loadBookmarks = ( ) => {
@@ -434,18 +449,26 @@ export function BookmarkList() {
434449 ) }
435450
436451 { filteredBookmarks . length === 0 && ! isAddingNew ? (
437- < div className = "flex flex-col items-center justify-center py-20 opacity-50" >
438- < PackageOpen className = "w-12 h-12 mb-4 stroke-1" />
439- < p className = "text-sm font-medium" > No bookmarks found</ p >
440- { filterView !== 'all' && (
441- < button
442- onClick = { ( ) => handleFilterChange ( 'all' ) }
443- className = "mt-2 text-sm text-primary hover:underline"
444- >
445- Clear filters
446- </ button >
447- ) }
448- </ div >
452+ isFirstRun && filterView === 'all' ? (
453+ < WelcomeState
454+ onAddBookmark = { openNewBookmarkForm }
455+ onImport = { ( ) => setCurrentView ( 'settings' ) }
456+ onPairDevice = { ( ) => setCurrentView ( 'settings' ) }
457+ />
458+ ) : (
459+ < div className = "flex flex-col items-center justify-center py-20 opacity-50" >
460+ < PackageOpen className = "w-12 h-12 mb-4 stroke-1" />
461+ < p className = "text-sm font-medium" > No bookmarks found</ p >
462+ { filterView !== 'all' && (
463+ < button
464+ onClick = { ( ) => handleFilterChange ( 'all' ) }
465+ className = "mt-2 text-sm text-primary hover:underline"
466+ >
467+ Clear filters
468+ </ button >
469+ ) }
470+ </ div >
471+ )
449472 ) : (
450473 filteredBookmarks . map ( ( bookmark , index ) => (
451474 editingBookmarkId === bookmark . _id ? (
0 commit comments