Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(mobile): Updated formatting of server address in networking #16483

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart' hide Store;
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:immich_mobile/domain/models/store.model.dart';
import 'package:immich_mobile/entities/store.entity.dart';
import 'package:immich_mobile/extensions/build_context_extensions.dart';
import 'package:immich_mobile/models/auth/auxilary_endpoint.model.dart';
import 'package:immich_mobile/providers/network.provider.dart';
import 'package:immich_mobile/services/app_settings.service.dart';
import 'package:immich_mobile/utils/hooks/app_settings_update_hook.dart';
import 'package:immich_mobile/utils/url_helper.dart';
import 'package:immich_mobile/widgets/settings/networking_settings/external_network_preference.dart';
import 'package:immich_mobile/widgets/settings/networking_settings/local_network_preference.dart';
import 'package:immich_mobile/widgets/settings/settings_switch_list_tile.dart';
Expand All @@ -18,7 +17,7 @@ class NetworkingSettings extends HookConsumerWidget {

@override
Widget build(BuildContext context, WidgetRef ref) {
final currentEndpoint = Store.get(StoreKey.serverEndpoint);
final currentEndpoint = getServerUrl();
final featureEnabled =
useAppSettingsState(AppSettingsEnum.autoEndpointSwitching);

Expand Down Expand Up @@ -102,7 +101,7 @@ class NetworkingSettings extends HookConsumerWidget {
padding: const EdgeInsets.only(top: 8, left: 16, bottom: 8),
child: NetworkPreferenceTitle(
title: "current_server_address".tr().toUpperCase(),
icon: currentEndpoint.startsWith('https')
icon: (currentEndpoint?.startsWith('https') ?? false)
? Icons.https_outlined
: Icons.http_outlined,
),
Expand All @@ -119,10 +118,16 @@ class NetworkingSettings extends HookConsumerWidget {
),
),
child: ListTile(
leading:
const Icon(Icons.check_circle_rounded, color: Colors.green),
leading: currentEndpoint != null
? const Icon(
Icons.check_circle_rounded,
color: Colors.green,
)
: const Icon(
Icons.circle_outlined,
),
title: Text(
currentEndpoint,
currentEndpoint ?? "--",
style: TextStyle(
fontSize: 16,
fontFamily: 'Inconsolata',
Expand Down
Loading