mirror of
https://github.com/immich-app/immich.git
synced 2026-04-16 07:31:55 -04:00
fix(mobile): readonly redirect when not logged in (#27728)
This commit is contained in:
parent
50557002b7
commit
37abbeba52
@ -1,5 +1,6 @@
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:immich_mobile/providers/app_settings.provider.dart';
|
||||
import 'package:immich_mobile/providers/auth.provider.dart';
|
||||
import 'package:immich_mobile/routing/router.dart';
|
||||
import 'package:immich_mobile/services/app_settings.service.dart';
|
||||
|
||||
@ -14,10 +15,11 @@ class ReadOnlyModeNotifier extends Notifier<bool> {
|
||||
}
|
||||
|
||||
void setMode(bool value) {
|
||||
final isLoggedIn = ref.read(authProvider).isAuthenticated;
|
||||
_appSettingService.setSetting(AppSettingsEnum.readonlyModeEnabled, value);
|
||||
state = value;
|
||||
|
||||
if (value) {
|
||||
if (value && isLoggedIn) {
|
||||
ref.read(appRouterProvider).navigate(const MainTimelineRoute());
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user