Added friendly message when using invalid characters in filename
authorAdam Dullage <redacted>
Fri, 17 Mar 2023 07:45:18 +0000 (07:45 +0000)
committerAdam Dullage <redacted>
Fri, 17 Mar 2023 07:45:18 +0000 (07:45 +0000)
flatnotes/src/components/NoteViewerEditor.vue

index 6603fdc1e7fcc15061b32e39a00eca5d24f0a6f1..b9884eccbbcb03ffbfc4250c82010de5c2121bbd 100644 (file)
@@ -350,6 +350,18 @@ export default {
         });
         return;
       }
+      const reservedCharacters = /[<>:"/\\|?*]/;
+      if (reservedCharacters.test(this.titleInput)) {
+        this.$bvToast.toast(
+          "Due to filename restrictions, the following characters are not allowed in a note title: <>:\"/\\|?*",
+          {
+            variant: "danger",
+            noCloseButton: true,
+            toaster: "b-toaster-bottom-right",
+          }
+        );
+        return;
+      }
 
       // New Note
       if (this.currentNote.lastModified == null) {
git clone https://git.99rst.org/PROJECT