diff --git a/manifest.json b/manifest.json index 0ff210c..f346a14 100644 --- a/manifest.json +++ b/manifest.json @@ -7,7 +7,7 @@ "discordID": "372148345894076416", "github": "SammCheese" }, - "version": "1.0.1", + "version": "1.0.2", "updater": { "type": "github", "id": "SammCheese/invisible-chat" diff --git a/src/components/DecryptionModal.tsx b/src/components/DecryptionModal.tsx index b739d21..0fb1b97 100644 --- a/src/components/DecryptionModal.tsx +++ b/src/components/DecryptionModal.tsx @@ -21,7 +21,7 @@ setTimeout(() => { export function buildDecModal(msg: any) { let secret: string = msg?.content; - let password: string; + let password: string = "password"; if (!TextInput || !Button) return; if (!ModalRoot || !ModalContent || !ModalHeader || !ModalFooter) return; const s = openModal!((props = msg) => ( diff --git a/src/components/EncryptionModal.tsx b/src/components/EncryptionModal.tsx index 4198832..b5caf95 100644 --- a/src/components/EncryptionModal.tsx +++ b/src/components/EncryptionModal.tsx @@ -22,9 +22,19 @@ setTimeout(() => { export function buildEncModal() { let secret: string; let cover: string; - let password: string; + let password: string = "password"; + let valid: boolean = false; if (!TextInput || !Button) return; if (!ModalRoot || !ModalContent || !ModalHeader || !ModalFooter) return; + + function isValid() { + if (secret && cover && cover.match(/\w \w/)) { + valid = true; + } else { + valid = false; + } // Enforcing the 2 words, space is NOT a valid thing + } + const s = openModal!((props) => ( @@ -35,21 +45,27 @@ export function buildEncModal() { { secret = e; + isValid(); }}> -
Cover
+
Cover (2 or more Words!!)
{ cover = e; + isValid(); }}>
Password
{ + isValid(); password = e; }}>