Skip to content

Commit

Permalink
pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
alextran1502 committed Dec 5, 2024
1 parent 93e086f commit 55f437a
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 47 deletions.
18 changes: 9 additions & 9 deletions mobile/assets/i18n/en-US.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"location_permission": "Location permission",
"location_permission_content": "Immich needs your permission to access the location permission to read the WiFi name",
"location_permission_content": "In order to use the auto-switching feature, Immich needs precise location permission so it can read the current WiFi network's name",
"background_location_permission": "Background location permission",
"background_location_permission_content": "Immich needs your permission to ALWAYS have access to the location permission to read the WiFi name when the app is uploading assets in the background",
"background_location_permission_content": "In order to switch networks when running in the background, Immich must *always* have precise location access so the app can read the Wi-Fi network's name",
"current_server_address": "Current server address",
"grant_permission": "Grant permission",
"automatic_endpoint_switching_title": "Automatic URLs switching",
"automatic_endpoint_switching_subtitle": "Switch between URLs automatically when on or off designated Wi-Fi networks",
"automatic_endpoint_switching_title": "Automatic URL switching",
"automatic_endpoint_switching_subtitle": "Connect locally over designated Wi-Fi when available and use alternative connections elsewhere",
"local_network": "Local network",
"local_network_sheet_info": "When connect to the following Wi-Fi network, the app will prioritize connecting to the server at the following endpoint",
"local_network_sheet_info": "The app will connect to the server through this URL when using the specified Wi-Fi network",
"external_network": "External network",
"external_network_sheet_info": "When not on the preferred WiFi network, the app will attempt to connect to the server at the following endpoints from top to bottom",
"external_network_sheet_info": "When not on the preferred WiFi network, the app will connect to the server through the first of the below URLs it can reach, starting from top to bottom",
"networking_settings": "Networking",
"networking_subtitle": "Manage the server endpoint settings",
"cancel": "Cancel",
Expand All @@ -19,12 +19,12 @@
"enter_wifi_name": "Enter WiFi name",
"your_wifi_name": "Your WiFi name",
"server_endpoint": "Server Endpoint",
"get_wifiname_error": "Cannot get Wi-Fi name, make sure you have granted the necessary permissions and connected to a Wi-Fi network",
"get_wifiname_error": "Could not get Wi-Fi name. Make sure you have granted the necessary permissions and are connected to a Wi-Fi network",
"use_current_connection": "use current connection",
"add_endpoint": "Add endpoint",
"validate_endpoint_error": "Please enter a valid URL",
"advanced_settings_tile_subtitle": "Manage advanced settings",
"asset_viewer_settings_subtitle": "Manage your detail viewer settings",
"asset_viewer_settings_subtitle": "Manage your gallery viewer settings",
"backup_setting_subtitle": "Manage background and foreground upload settings",
"setting_languages_subtitle": "Change the app's language",
"setting_notifications_subtitle": "Manage your notification settings",
Expand Down Expand Up @@ -94,7 +94,7 @@
"assets_restored_successfully": "{} asset(s) restored successfully",
"assets_trashed": "{} asset(s) trashed",
"assets_trashed_from_server": "{} asset(s) trashed from the Immich server",
"asset_viewer_settings_title": "Asset Viewer",
"asset_viewer_settings_title": "Gallery Viewer",
"backup_album_selection_page_albums_device": "Albums on device ({})",
"backup_album_selection_page_albums_tap": "Tap to include, double tap to exclude",
"backup_album_selection_page_assets_scatter": "Assets can scatter across multiple albums. Thus, albums can be included or excluded during the backup process.",
Expand Down
6 changes: 1 addition & 5 deletions mobile/lib/pages/common/settings.page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,12 @@ class _MobileLayout extends StatelessWidget {
title: Text(
setting.title,
style: context.textTheme.titleMedium!.copyWith(
fontWeight: FontWeight.w600,
color: context.primaryColor,
),
).tr(),
subtitle: Text(
setting.subtitle,
style: TextStyle(
color: context.isDarkTheme
? Colors.white
: context.colorScheme.onSurface,
),
).tr(),
onTap: () =>
context.pushRoute(SettingsSubRoute(section: setting)),
Expand Down
14 changes: 11 additions & 3 deletions mobile/lib/providers/app_life_cycle.provider.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:flutter/foundation.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:immich_mobile/providers/album/album.provider.dart';
import 'package:immich_mobile/services/background.service.dart';
Expand Down Expand Up @@ -47,7 +48,11 @@ class AppLifeCycleNotifier extends StateNotifier<AppLifeCycleEnum> {
// Needs to be logged in
if (isAuthenticated) {
// switch endpoint if needed
await _ref.read(authProvider.notifier).setOpenApiServiceEndpoint();
final endpoint =
await _ref.read(authProvider.notifier).setOpenApiServiceEndpoint();
if (kDebugMode) {
debugPrint("Using server URL: $endpoint");
}

final permission = _ref.watch(galleryPermissionNotifier);
if (permission.isGranted || permission.isLimited) {
Expand All @@ -62,12 +67,15 @@ class AppLifeCycleNotifier extends StateNotifier<AppLifeCycleEnum> {
await _ref.read(assetProvider.notifier).getAllAsset();
break;
case TabEnum.search:
// nothing to do
// nothing to do
break;

case TabEnum.albums:
await _ref.read(albumProvider.notifier).refreshRemoteAlbums();
break;
case TabEnum.library:
// nothing to do
// nothing to do
break;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,15 @@ class ExternalNetworkPreference extends HookConsumerWidget {
),
child: Stack(
children: [
Positioned(
bottom: -36,
right: -36,
child: Icon(
Icons.dns_rounded,
size: 120,
color: context.primaryColor.withOpacity(0.05),
),
),
ListView(
padding: const EdgeInsets.symmetric(vertical: 16.0),
physics: const ClampingScrollPhysics(),
Expand Down Expand Up @@ -172,15 +181,6 @@ class ExternalNetworkPreference extends HookConsumerWidget {
),
],
),
Positioned(
bottom: -36,
right: -36,
child: Icon(
Icons.dns_rounded,
size: 120,
color: context.primaryColor.withOpacity(0.05),
),
),
],
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,15 @@ class LocalNetworkPreference extends HookConsumerWidget {
),
child: Stack(
children: [
Positioned(
bottom: -36,
right: -36,
child: Icon(
Icons.home_outlined,
size: 120,
color: context.primaryColor.withOpacity(0.05),
),
),
ListView(
padding: const EdgeInsets.symmetric(vertical: 16.0),
physics: const ClampingScrollPhysics(),
Expand Down Expand Up @@ -237,15 +246,6 @@ class LocalNetworkPreference extends HookConsumerWidget {
),
],
),
Positioned(
bottom: -36,
right: -36,
child: Icon(
Icons.home_outlined,
size: 120,
color: context.primaryColor.withOpacity(0.05),
),
),
],
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,19 +236,29 @@ class NetworkStatusIcon extends StatelessWidget {
),
);
case AuxCheckStatus.valid:
return Icon(
Icons.check_circle_rounded,
color: enabled
? Colors.green
: context.colorScheme.onSurface.withAlpha(100),
key: const ValueKey('success'),
);
return enabled
? const Icon(
Icons.check_circle_rounded,
color: Colors.green,
key: ValueKey('success'),
)
: Icon(
Icons.check_circle_rounded,
color: context.colorScheme.onSurface.withAlpha(100),
key: const ValueKey('success'),
);
case AuxCheckStatus.error:
return Icon(
Icons.error_rounded,
color: enabled ? Colors.red : Colors.grey,
key: const ValueKey('error'),
);
return enabled
? const Icon(
Icons.error_rounded,
color: Colors.red,
key: ValueKey('error'),
)
: const Icon(
Icons.error_rounded,
color: Colors.grey,
key: ValueKey('error'),
);
default:
return const Icon(Icons.circle_outlined, key: ValueKey('unknown'));
}
Expand Down

0 comments on commit 55f437a

Please sign in to comment.