mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-04-21 14:29:13 +00:00
Merge pull request #1604 from alexbakker/flush-export
Flush temporary export file before starting ExportTask
This commit is contained in:
commit
7882ecc33a
1 changed files with 3 additions and 2 deletions
|
@ -518,11 +518,10 @@ public class ImportExportPreferencesFragment extends PreferencesFragment {
|
||||||
file = File.createTempFile(VaultRepository.FILENAME_PREFIX_EXPORT + "-", ".json", getExportCacheDir());
|
file = File.createTempFile(VaultRepository.FILENAME_PREFIX_EXPORT + "-", ".json", getExportCacheDir());
|
||||||
outStream = new FileOutputStream(file);
|
outStream = new FileOutputStream(file);
|
||||||
cb.exportVault(outStream);
|
cb.exportVault(outStream);
|
||||||
|
|
||||||
new ExportTask(requireContext(), new ExportResultListener()).execute(getLifecycle(), new ExportTask.Params(file, uri));
|
|
||||||
} catch (VaultRepositoryException | IOException e) {
|
} catch (VaultRepositoryException | IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
Dialogs.showErrorDialog(requireContext(), R.string.exporting_vault_error, e);
|
Dialogs.showErrorDialog(requireContext(), R.string.exporting_vault_error, e);
|
||||||
|
return;
|
||||||
} finally {
|
} finally {
|
||||||
try {
|
try {
|
||||||
if (outStream != null) {
|
if (outStream != null) {
|
||||||
|
@ -532,6 +531,8 @@ public class ImportExportPreferencesFragment extends PreferencesFragment {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
new ExportTask(requireContext(), new ExportResultListener()).execute(getLifecycle(), new ExportTask.Params(file, uri));
|
||||||
}, _exportFilter);
|
}, _exportFilter);
|
||||||
_exportFilter = null;
|
_exportFilter = null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue