mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-05-21 05:57:06 +02:00
fix: Don't show toasts when export cancelled (#2230)
This commit is contained in:
parent
820cd720b5
commit
bd79496433
@ -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',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
if (status != null) {
|
||||||
_toast.showBottom(t.settingsView.exportedPatches);
|
_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',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
if (status != null) {
|
||||||
_toast.showBottom(t.settingsView.exportedKeystore);
|
_toast.showBottom(t.settingsView.exportedKeystore);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
_toast.showBottom(t.settingsView.noKeystoreExportFileFound);
|
_toast.showBottom(t.settingsView.noKeystoreExportFileFound);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user