diff --git a/GSCFieldApp/Services/FileServices/FileServices.cs b/GSCFieldApp/Services/FileServices/FileServices.cs index c2aec103..57dd1421 100644 --- a/GSCFieldApp/Services/FileServices/FileServices.cs +++ b/GSCFieldApp/Services/FileServices/FileServices.cs @@ -310,6 +310,12 @@ public async Task SaveArchiveCopy(string fieldbookpath = "", string curr } } + + //Clean up + if (File.Exists(tempZip)) + { + File.Delete(tempZip); + } } return outputZipPhotoFilePath; diff --git a/GSCFieldApp/ViewModels/FieldBooksPageViewModel.cs b/GSCFieldApp/ViewModels/FieldBooksPageViewModel.cs index ba8da741..e44b115c 100644 --- a/GSCFieldApp/ViewModels/FieldBooksPageViewModel.cs +++ b/GSCFieldApp/ViewModels/FieldBooksPageViewModel.cs @@ -539,7 +539,6 @@ public async Task BackupFieldBook() //Zip and Copy string outputZipFilePath = await fs.SaveArchiveCopy(selectedBook.ProjectPath, selectedBook.metadataForProject.UserCode); - } } diff --git a/GSCFieldApp/ViewModels/ShellViewModel.cs b/GSCFieldApp/ViewModels/ShellViewModel.cs index c96bca71..41c13e64 100644 --- a/GSCFieldApp/ViewModels/ShellViewModel.cs +++ b/GSCFieldApp/ViewModels/ShellViewModel.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Linq; using Template10.Mvvm; using Windows.Storage; using Windows.UI.Xaml; @@ -148,7 +149,7 @@ public async void QuickBackupAsync() } //If any photos needs to be copied, else show warning - if (FilesToBackup.Count > 1) + if (FilesToBackup.Count > 1 && FilesToBackup.Where(x=>x.FileType != DatabaseLiterals.DBTypeSqlite).Count() > 0) { //Copy database and rename it List newList = new List();