mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
Implemented load new image when navigating back from backup page (#9)
This commit is contained in:
@@ -2,7 +2,6 @@ import 'package:auto_route/auto_route.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:immich_mobile/modules/home/providers/asset.provider.dart';
|
||||
|
||||
import 'package:immich_mobile/routing/router.dart';
|
||||
import 'package:immich_mobile/shared/models/backup_state.model.dart';
|
||||
@@ -12,9 +11,11 @@ class ImmichSliverAppBar extends ConsumerWidget {
|
||||
const ImmichSliverAppBar({
|
||||
Key? key,
|
||||
required this.imageGridGroup,
|
||||
this.onPopBack,
|
||||
}) : super(key: key);
|
||||
|
||||
final List<Widget> imageGridGroup;
|
||||
final Function? onPopBack;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
@@ -75,15 +76,7 @@ class ImmichSliverAppBar extends ConsumerWidget {
|
||||
var onPop = await AutoRouter.of(context).push(const BackupControllerRoute());
|
||||
|
||||
if (onPop == true) {
|
||||
// Remove and force getting new widget again if there is not many widget on screen.
|
||||
// Otherwise do nothing.
|
||||
if (imageGridGroup.isNotEmpty && imageGridGroup.length < 20) {
|
||||
print("Get more access");
|
||||
ref.read(assetProvider.notifier).getMoreAsset();
|
||||
} else if (imageGridGroup.isEmpty) {
|
||||
print("get immich asset");
|
||||
ref.read(assetProvider.notifier).getImmichAssets();
|
||||
}
|
||||
onPopBack!();
|
||||
}
|
||||
},
|
||||
),
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
import 'package:auto_route/annotations.dart';
|
||||
import 'package:auto_route/auto_route.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/src/widgets/framework.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:immich_mobile/modules/home/providers/asset.provider.dart';
|
||||
import 'package:immich_mobile/modules/login/models/authentication_state.model.dart';
|
||||
import 'package:immich_mobile/modules/login/providers/authentication.provider.dart';
|
||||
import 'package:immich_mobile/routing/router.dart';
|
||||
|
||||
class ProfileDrawer extends ConsumerWidget {
|
||||
const ProfileDrawer({Key? key}) : super(key: key);
|
||||
@@ -58,6 +55,7 @@ class ProfileDrawer extends ConsumerWidget {
|
||||
),
|
||||
onTap: () async {
|
||||
bool res = await ref.read(authenticationProvider.notifier).logout();
|
||||
|
||||
ref.read(assetProvider.notifier).clearAllAsset();
|
||||
|
||||
if (res) {
|
||||
|
||||
Reference in New Issue
Block a user