File tree Expand file tree Collapse file tree 1 file changed +24
-26
lines changed
demos/react-supabase-todolist/src/app/views Expand file tree Collapse file tree 1 file changed +24
-26
lines changed Original file line number Diff line number Diff line change @@ -90,33 +90,31 @@ export default function ViewsLayout({ children }: { children: React.ReactNode })
9090 setConnectionAnchor ( event . currentTarget ) ;
9191 } } >
9292 { status ?. connected ? < WifiIcon /> : < SignalWifiOffIcon /> }
93- { /* Allows for manual connection and disconnect for testing purposes */ }
94- < Menu
95- id = "connection-menu"
96- anchorEl = { connectionAnchor }
97- open = { Boolean ( connectionAnchor ) }
98- onClose = { ( ) => setConnectionAnchor ( null ) } >
99- { status ?. connected ? (
100- < MenuItem
101- onClick = { ( event ) => {
102- event . stopPropagation ( ) ;
103- setConnectionAnchor ( null ) ;
104- powerSync . disconnect ( ) ;
105- } } >
106- Disconnect
107- </ MenuItem >
108- ) : supabase ? (
109- < MenuItem
110- onClick = { ( event ) => {
111- event . stopPropagation ( ) ;
112- setConnectionAnchor ( null ) ;
113- powerSync . connect ( supabase ) ;
114- } } >
115- Connect
116- </ MenuItem >
117- ) : null }
118- </ Menu >
11993 </ Box >
94+ { /* Allows for manual connection and disconnect for testing purposes */ }
95+ < Menu
96+ id = "connection-menu"
97+ anchorEl = { connectionAnchor }
98+ open = { Boolean ( connectionAnchor ) }
99+ onClose = { ( ) => setConnectionAnchor ( null ) } >
100+ { status ?. connected || status ?. connecting ? (
101+ < MenuItem
102+ onClick = { ( event ) => {
103+ setConnectionAnchor ( null ) ;
104+ powerSync . disconnect ( ) ;
105+ } } >
106+ Disconnect
107+ </ MenuItem >
108+ ) : supabase ? (
109+ < MenuItem
110+ onClick = { ( event ) => {
111+ setConnectionAnchor ( null ) ;
112+ powerSync . connect ( supabase ) ;
113+ } } >
114+ Connect
115+ </ MenuItem >
116+ ) : null }
117+ </ Menu >
120118 </ Toolbar >
121119 </ S . TopBar >
122120 < Drawer anchor = { 'left' } open = { openDrawer } onClose = { ( ) => setOpenDrawer ( false ) } >
You can’t perform that action at this time.
0 commit comments