Skip to content

Commit

Permalink
Merge branch 'main' into fix/user-removal-from-option-menu-on-the-top…
Browse files Browse the repository at this point in the history
…-in-shared-album
  • Loading branch information
Pranav-8bit authored Sep 26, 2024
2 parents d33216a + 63ad3c8 commit 9b2d694
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
16 changes: 16 additions & 0 deletions mobile/lib/utils/provider_utils.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:immich_mobile/repositories/activity_api.repository.dart';
import 'package:immich_mobile/repositories/album_api.repository.dart';
import 'package:immich_mobile/repositories/asset_api.repository.dart';
import 'package:immich_mobile/repositories/partner_api.repository.dart';
import 'package:immich_mobile/repositories/person_api.repository.dart';
import 'package:immich_mobile/repositories/user_api.repository.dart';

void invalidateAllApiRepositoryProviders(WidgetRef ref) {
ref.invalidate(userApiRepositoryProvider);
ref.invalidate(activityApiRepositoryProvider);
ref.invalidate(partnerApiRepositoryProvider);
ref.invalidate(albumApiRepositoryProvider);
ref.invalidate(personApiRepositoryProvider);
ref.invalidate(assetApiRepositoryProvider);
}
4 changes: 4 additions & 0 deletions mobile/lib/widgets/forms/login/login_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import 'package:immich_mobile/providers/asset.provider.dart';
import 'package:immich_mobile/providers/authentication.provider.dart';
import 'package:immich_mobile/providers/backup/backup.provider.dart';
import 'package:immich_mobile/providers/server_info.provider.dart';
import 'package:immich_mobile/utils/provider_utils.dart';
import 'package:immich_mobile/utils/version_compatibility.dart';
import 'package:immich_mobile/widgets/common/immich_logo.dart';
import 'package:immich_mobile/widgets/common/immich_title_text.dart';
Expand Down Expand Up @@ -186,6 +187,9 @@ class LoginForm extends HookConsumerWidget {
// This will remove current cache asset state of previous user login.
ref.read(assetProvider.notifier).clearAllAsset();

// Invalidate all api repository provider instance to take into account new access token
invalidateAllApiRepositoryProviders(ref);

try {
final isAuthenticated =
await ref.read(authenticationProvider.notifier).login(
Expand Down

0 comments on commit 9b2d694

Please sign in to comment.