@@ -2,13 +2,12 @@ import 'package:easy_localization/easy_localization.dart';
2
2
import 'package:flutter/material.dart' ;
3
3
import 'package:flutter_hooks/flutter_hooks.dart' hide Store;
4
4
import 'package:hooks_riverpod/hooks_riverpod.dart' ;
5
- import 'package:immich_mobile/domain/models/store.model.dart' ;
6
- import 'package:immich_mobile/entities/store.entity.dart' ;
7
5
import 'package:immich_mobile/extensions/build_context_extensions.dart' ;
8
6
import 'package:immich_mobile/models/auth/auxilary_endpoint.model.dart' ;
9
7
import 'package:immich_mobile/providers/network.provider.dart' ;
10
8
import 'package:immich_mobile/services/app_settings.service.dart' ;
11
9
import 'package:immich_mobile/utils/hooks/app_settings_update_hook.dart' ;
10
+ import 'package:immich_mobile/utils/url_helper.dart' ;
12
11
import 'package:immich_mobile/widgets/settings/networking_settings/external_network_preference.dart' ;
13
12
import 'package:immich_mobile/widgets/settings/networking_settings/local_network_preference.dart' ;
14
13
import 'package:immich_mobile/widgets/settings/settings_switch_list_tile.dart' ;
@@ -18,7 +17,7 @@ class NetworkingSettings extends HookConsumerWidget {
18
17
19
18
@override
20
19
Widget build (BuildContext context, WidgetRef ref) {
21
- final currentEndpoint = Store . get ( StoreKey .serverEndpoint );
20
+ final currentEndpoint = getServerUrl ( );
22
21
final featureEnabled =
23
22
useAppSettingsState (AppSettingsEnum .autoEndpointSwitching);
24
23
@@ -102,7 +101,7 @@ class NetworkingSettings extends HookConsumerWidget {
102
101
padding: const EdgeInsets .only (top: 8 , left: 16 , bottom: 8 ),
103
102
child: NetworkPreferenceTitle (
104
103
title: "current_server_address" .tr ().toUpperCase (),
105
- icon: currentEndpoint.startsWith ('https' )
104
+ icon: ( currentEndpoint? .startsWith ('https' ) ?? false )
106
105
? Icons .https_outlined
107
106
: Icons .http_outlined,
108
107
),
@@ -119,10 +118,16 @@ class NetworkingSettings extends HookConsumerWidget {
119
118
),
120
119
),
121
120
child: ListTile (
122
- leading:
123
- const Icon (Icons .check_circle_rounded, color: Colors .green),
121
+ leading: currentEndpoint != null
122
+ ? const Icon (
123
+ Icons .check_circle_rounded,
124
+ color: Colors .green,
125
+ )
126
+ : const Icon (
127
+ Icons .circle_outlined,
128
+ ),
124
129
title: Text (
125
- currentEndpoint,
130
+ currentEndpoint ?? "--" ,
126
131
style: TextStyle (
127
132
fontSize: 16 ,
128
133
fontFamily: 'Inconsolata' ,
0 commit comments