File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -121,12 +121,9 @@ static async Task Main()
121121
122122 _ = Task . Run ( async ( ) =>
123123 {
124- await foreach ( var update in db . ListenAsync ( new CancellationToken ( ) ) )
124+ await foreach ( var update in db . Events . OnStatusChanged . ListenAsync ( new CancellationToken ( ) ) )
125125 {
126- if ( update . StatusChanged != null )
127- {
128- connected = update . StatusChanged . Connected ;
129- }
126+ connected = update . Status . Connected ;
130127 }
131128 } ) ;
132129
Original file line number Diff line number Diff line change @@ -22,15 +22,12 @@ protected override async void OnAppearing()
2222
2323 _ = Task . Run ( async ( ) =>
2424 {
25- await foreach ( var update in database . Db . ListenAsync ( new CancellationToken ( ) ) )
25+ await foreach ( var update in database . Db . Events . OnStatusChanged . ListenAsync ( new CancellationToken ( ) ) )
2626 {
27- if ( update . StatusChanged != null )
27+ MainThread . BeginInvokeOnMainThread ( ( ) =>
2828 {
29- MainThread . BeginInvokeOnMainThread ( ( ) =>
30- {
31- WifiStatusItem . IconImageSource = update . StatusChanged . Connected ? "wifi.png" : "wifi_off.png" ;
32- } ) ;
33- }
29+ WifiStatusItem . IconImageSource = update . Status . Connected ? "wifi.png" : "wifi_off.png" ;
30+ } ) ;
3431 }
3532 } ) ;
3633
You can’t perform that action at this time.
0 commit comments