Prechádzať zdrojové kódy

Add unsyced local folder for backup before creating public link

Neeraj Gupta 3 rokov pred
rodič
commit
a180766b1e
1 zmenil súbory, kde vykonal 13 pridanie a 0 odobranie
  1. 13 0
      lib/ui/share_collection_widget.dart

+ 13 - 0
lib/ui/share_collection_widget.dart

@@ -140,6 +140,19 @@ class _SharingDialogState extends State<SharingDialog> {
                     if (choice != DialogUserChoice.firstChoice) {
                       return;
                     }
+                  } else {
+                    // Add local folder in backup patch before creating
+                    // sharable link
+                    if (widget.collection.type == CollectionType.folder) {
+                      final path = CollectionsService.instance
+                          .decryptCollectionPath(widget.collection);
+                      if (!Configuration.instance
+                          .getPathsToBackUp()
+                          .contains(path)) {
+                        await Configuration.instance
+                            .addPathToFoldersToBeBackedUp(path);
+                      }
+                    }
                   }
                   final dialog = createProgressDialog(
                     context,