mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 23:34:24 +01:00
fix & opt.
fix: servers will only refresh once if `spi.autoConnect` is false opt.: `UrlText` algo
This commit is contained in:
@@ -104,7 +104,15 @@ class ServerProvider extends ChangeNotifier {
|
||||
if (s.state != ServerState.failed) return;
|
||||
_limiter.reset(s.spi.id);
|
||||
}
|
||||
if (!(s.spi.autoConnect ?? true)) return;
|
||||
/// If [spi.autoConnect] is false and server is disconnected, then skip.
|
||||
///
|
||||
/// If [spi.autoConnect] is false and server is connected, then refresh.
|
||||
/// If no this, the server will only refresh once by clicking refresh button.
|
||||
///
|
||||
/// If [spi.autoConnect] is true, then refresh.
|
||||
if (!(s.spi.autoConnect ?? true) && s.state == ServerState.disconnected) {
|
||||
return;
|
||||
}
|
||||
return await _getData(s.spi);
|
||||
}));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user