mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-04-21 06:19:10 +00:00
Bugs fixed
This commit is contained in:
parent
c1950fdc2b
commit
1ea71265e2
6 changed files with 54 additions and 36 deletions
|
@ -76,7 +76,7 @@ class DhcpStatus {
|
|||
v6: json["v6"] != null ? IpVersion.fromJson(json["v6"]) : null,
|
||||
leases: List<Lease>.from(json["leases"].map((x) => Lease.fromJson(x))),
|
||||
staticLeases: List<Lease>.from(json["static_leases"].map((x) => Lease.fromJson(x))),
|
||||
enabled: json["enabled"],
|
||||
enabled: json["enabled"] ?? false,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
|
|
|
@ -132,7 +132,7 @@ class _FiltersListState extends State<FiltersList> {
|
|||
TextButton.icon(
|
||||
onPressed: () async {
|
||||
final result = await filteringProvider.fetchFilters();
|
||||
if (result == false) {
|
||||
if (result == false && mounted) {
|
||||
showSnacbkar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.errorLoadFilters,
|
||||
|
|
|
@ -70,7 +70,7 @@ class _ClientsListState extends State<ClientsList> {
|
|||
|
||||
Future refetchClients() async {
|
||||
final result = await clientsProvider.fetchClients();
|
||||
if (result == false) {
|
||||
if (result == false && mounted) {
|
||||
showSnacbkar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.clientsNotLoaded,
|
||||
|
|
|
@ -24,6 +24,7 @@ class AdvancedSettings extends StatelessWidget {
|
|||
required Future Function(bool) function
|
||||
}) async {
|
||||
final result = await function(newStatus);
|
||||
if (!context.mounted) return;
|
||||
if (result == true) {
|
||||
showSnacbkar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
|
|
|
@ -1330,6 +1330,7 @@ class ApiClient {
|
|||
}
|
||||
|
||||
Future getDhcpData() async {
|
||||
try {
|
||||
final result = await Future.wait([
|
||||
apiRequest(
|
||||
urlPath: '/dhcp/interfaces',
|
||||
|
@ -1382,6 +1383,18 @@ class ApiClient {
|
|||
)
|
||||
};
|
||||
}
|
||||
} catch (e) {
|
||||
Sentry.captureException(e);
|
||||
return {
|
||||
'result': 'error',
|
||||
'log': AppLog(
|
||||
type: 'get_dhpc_data',
|
||||
dateTime: DateTime.now(),
|
||||
message: 'error_code_not_expected',
|
||||
resBody: e.toString(),
|
||||
)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Future saveDhcpConfig({
|
||||
|
|
|
@ -153,7 +153,9 @@ class _LayoutState extends State<Layout> with WidgetsBindingObserver {
|
|||
child: child,
|
||||
)
|
||||
),
|
||||
child: screens[appConfigProvider.selectedScreen].child,
|
||||
child: appConfigProvider.selectedScreen < screens.length
|
||||
? screens[appConfigProvider.selectedScreen].child
|
||||
: screens[0].child,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -177,7 +179,9 @@ class _LayoutState extends State<Layout> with WidgetsBindingObserver {
|
|||
child: child,
|
||||
)
|
||||
),
|
||||
child: screens[appConfigProvider.selectedScreen].child,
|
||||
child: appConfigProvider.selectedScreen < screens.length
|
||||
? screens[appConfigProvider.selectedScreen].child
|
||||
: screens[0].child,
|
||||
),
|
||||
bottomNavigationBar: NavigationBar(
|
||||
selectedIndex: (serversProvider.selectedServer == null || serversProvider.apiClient == null) && appConfigProvider.selectedScreen > 1
|
||||
|
|
Loading…
Add table
Reference in a new issue