File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ else if (_locations != null)
5959 private string ? _clientId = null ;
6060
6161 private Location []? _locations = null ;
62- private object ? _selectedLocation ;
62+ private Location ? _selectedLocation ;
6363
6464 private bool _loading ;
6565
@@ -77,11 +77,11 @@ else if (_locations != null)
7777
7878 private void Update (GardenaLocation thing )
7979 {
80- if (_selectedLocation is Location selectedLocation )
80+ if (_selectedLocation is not null )
8181 {
8282 thing .Username = _username ;
8383 thing .Password = _password ;
84- thing .LocationId = selectedLocation .Id ;
84+ thing .LocationId = _selectedLocation .Id ;
8585 thing .Reset ();
8686 }
8787 }
@@ -112,7 +112,7 @@ else if (_locations != null)
112112 {
113113 try
114114 {
115- if (_selectedLocation is Location selectedLocation )
115+ if (_selectedLocation is not null )
116116 {
117117 var thing = (GardenaLocation )ActivatorUtilities .CreateInstance (ServiceProvider , typeof (GardenaLocation ));
118118 Update (thing );
Original file line number Diff line number Diff line change 6161}
6262
6363@code {
64- private object ? _selectedBridge ;
64+ private BridgeModel ? _selectedBridge ;
6565
6666 private BridgeModel []? Bridges { get ; set ; }
6767
7878 var response = await httpClient .GetAsync (" https://api.nuki.io/discover/bridges" );
7979 var result = JsonSerializer .Deserialize <DiscoverResult >(await response .Content .ReadAsStringAsync ());
8080
81- Bridges = result ? .Bridges ?? new BridgeModel [ 0 ];
81+ Bridges = result ? .Bridges ?? [ ];
8282 }
8383 catch (Exception e )
8484 {
117117 {
118118 try
119119 {
120- if (_selectedBridge is BridgeModel selectedBridge )
120+ if (_selectedBridge is { } selectedBridge )
121121 {
122122 IsWaitingForButton = true ;
123123 await InvokeAsync (StateHasChanged );
You can’t perform that action at this time.
0 commit comments