Fix update dialog looping after download completes

After OpenFile.open() the state was reset to UpdateStatus.available,
which re-triggered the app.dart listener (downloading → available
satisfies the prev != available condition) and showed the dialog again.
Fix: reset to idle so the system installer can proceed uninterrupted.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-02 22:14:15 -05:00
parent 3c3055d536
commit 04b7e1cc8a
+3 -5
View File
@@ -124,11 +124,9 @@ class UpdateNotifier extends Notifier<UpdateState> {
type: 'application/vnd.android.package-archive',
);
// Return to available so the user can retry install if they dismissed it.
state = state.copyWith(
status: UpdateStatus.available,
downloadProgress: 1.0,
);
// Transition to idle the system installer is now open.
// Going back to `available` would re-trigger the update dialog loop.
state = const UpdateState();
} catch (e) {
state = state.copyWith(
status: UpdateStatus.error,