mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
fix(mobile): closing editor goes back to main page (#22647)
Co-authored-by: bwees <brandonwees@gmail.com>
This commit is contained in:
parent
ad87dff18d
commit
d02a82b618
2 changed files with 10 additions and 10 deletions
|
|
@ -50,6 +50,11 @@ class DriftEditImagePage extends ConsumerWidget {
|
|||
return completer.future;
|
||||
}
|
||||
|
||||
void _exitEditing(BuildContext context) {
|
||||
// this assumes that the only way to get to this page is from the AssetViewerRoute
|
||||
context.navigator.popUntil((route) => route.data?.name == AssetViewerRoute.name);
|
||||
}
|
||||
|
||||
Future<void> _saveEditedImage(BuildContext context, BaseAsset asset, Image image, WidgetRef ref) async {
|
||||
try {
|
||||
final Uint8List imageData = await _imageToUint8List(image);
|
||||
|
|
@ -66,7 +71,7 @@ class DriftEditImagePage extends ConsumerWidget {
|
|||
}
|
||||
|
||||
ref.read(backgroundSyncProvider).syncLocal(full: true);
|
||||
context.navigator.popUntil((route) => route.isFirst);
|
||||
_exitEditing(context);
|
||||
ImmichToast.show(durationInSecond: 3, context: context, msg: 'Image Saved!');
|
||||
|
||||
if (localAsset == null) {
|
||||
|
|
@ -91,7 +96,7 @@ class DriftEditImagePage extends ConsumerWidget {
|
|||
backgroundColor: context.scaffoldBackgroundColor,
|
||||
leading: IconButton(
|
||||
icon: Icon(Icons.close_rounded, color: context.primaryColor, size: 24),
|
||||
onPressed: () => context.navigator.popUntil((route) => route.isFirst),
|
||||
onPressed: () => _exitEditing(context),
|
||||
),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue