mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2025-05-11 21:15:37 +02:00
fix: Don't show toasts when export cancelled (#2230)
This commit is contained in:
parent
820cd720b5
commit
bd79496433
1 changed files with 8 additions and 4 deletions
|
@ -228,13 +228,15 @@ class SettingsViewModel extends BaseViewModel {
|
||||||
if (outFile.existsSync()) {
|
if (outFile.existsSync()) {
|
||||||
final String dateTime =
|
final String dateTime =
|
||||||
DateTime.now().toString().replaceAll(' ', '_').split('.').first;
|
DateTime.now().toString().replaceAll(' ', '_').split('.').first;
|
||||||
await FlutterFileDialog.saveFile(
|
final status = await FlutterFileDialog.saveFile(
|
||||||
params: SaveFileDialogParams(
|
params: SaveFileDialogParams(
|
||||||
sourceFilePath: outFile.path,
|
sourceFilePath: outFile.path,
|
||||||
fileName: 'selected_patches_$dateTime.json',
|
fileName: 'selected_patches_$dateTime.json',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
_toast.showBottom(t.settingsView.exportedPatches);
|
if (status != null) {
|
||||||
|
_toast.showBottom(t.settingsView.exportedPatches);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
_toast.showBottom(t.settingsView.noExportFileFound);
|
_toast.showBottom(t.settingsView.noExportFileFound);
|
||||||
}
|
}
|
||||||
|
@ -279,13 +281,15 @@ class SettingsViewModel extends BaseViewModel {
|
||||||
if (outFile.existsSync()) {
|
if (outFile.existsSync()) {
|
||||||
final String dateTime =
|
final String dateTime =
|
||||||
DateTime.now().toString().replaceAll(' ', '_').split('.').first;
|
DateTime.now().toString().replaceAll(' ', '_').split('.').first;
|
||||||
await FlutterFileDialog.saveFile(
|
final status = await FlutterFileDialog.saveFile(
|
||||||
params: SaveFileDialogParams(
|
params: SaveFileDialogParams(
|
||||||
sourceFilePath: outFile.path,
|
sourceFilePath: outFile.path,
|
||||||
fileName: 'keystore_$dateTime.keystore',
|
fileName: 'keystore_$dateTime.keystore',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
_toast.showBottom(t.settingsView.exportedKeystore);
|
if (status != null) {
|
||||||
|
_toast.showBottom(t.settingsView.exportedKeystore);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
_toast.showBottom(t.settingsView.noKeystoreExportFileFound);
|
_toast.showBottom(t.settingsView.noKeystoreExportFileFound);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue