File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
tools/diagnostics-app/src/app/views Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ export default function ViewsLayout({ children }: { children: React.ReactNode })
43
43
const powerSync = usePowerSync ( ) ;
44
44
const navigate = useNavigate ( ) ;
45
45
46
- const [ syncStatus , setSyncStatus ] = React . useState ( sync . syncStatus ) ;
46
+ const [ syncStatus , setSyncStatus ] = React . useState ( sync ? .syncStatus ) ;
47
47
const [ syncError , setSyncError ] = React . useState < Error | null > ( null ) ;
48
48
const { title } = useNavigationPanel ( ) ;
49
49
@@ -101,13 +101,13 @@ export default function ViewsLayout({ children }: { children: React.ReactNode })
101
101
102
102
// Cannot use `useStatus()`, since we're not using the default sync implementation.
103
103
React . useEffect ( ( ) => {
104
- const l = sync . registerListener ( {
104
+ const l = sync ? .registerListener ( {
105
105
statusChanged : ( status ) => {
106
106
setSyncStatus ( status ) ;
107
107
setSyncError ( status . dataFlowStatus . downloadError ?? null ) ;
108
108
}
109
109
} ) ;
110
- return ( ) => l ( ) ;
110
+ return ( ) => l ?. ( ) ;
111
111
} , [ ] ) ;
112
112
113
113
const drawerWidth = 320 ;
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ export default function SyncDiagnosticsPage() {
82
82
// Similar to db.currentState.hasSynced, but synchronized to the onChange events
83
83
const { synced_at } = await db . get < { synced_at : string | null } > ( 'SELECT powersync_last_synced_at() as synced_at' ) ;
84
84
setlastSyncedAt ( synced_at ? new Date ( synced_at + 'Z' ) : null ) ;
85
- if ( synced_at != null && ! sync . syncStatus . dataFlowStatus . downloading ) {
85
+ if ( synced_at != null && ! sync ? .syncStatus . dataFlowStatus . downloading ) {
86
86
// These are potentially expensive queries - do not run during initial sync
87
87
const bucketRows = await db . getAll ( BUCKETS_QUERY ) ;
88
88
const tableRows = await db . getAll ( TABLES_QUERY ) ;
You can’t perform that action at this time.
0 commit comments