From feaee8171146be1b27accd8c35ee85c0f99a9938 Mon Sep 17 00:00:00 2001 From: Miodec Date: Sat, 19 Jun 2021 21:02:38 +0100 Subject: [PATCH 1/6] using credentials instead of pass to reauthenticate before updating the email address --- src/js/simple-popups.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/simple-popups.js b/src/js/simple-popups.js index 8c67f74e6..536bc33df 100644 --- a/src/js/simple-popups.js +++ b/src/js/simple-popups.js @@ -168,7 +168,7 @@ list.updateEmail = new SimplePopup( pass ); Loader.show(); - user.reauthenticateWithCredential(pass).then(() => { + user.reauthenticateWithCredential(credential).then(() => { CloudFunctions.updateEmail({ uid: user.uid, previousEmail: previousEmail, From ca4730abae224f02465654006f42640d9e36ff75 Mon Sep 17 00:00:00 2001 From: Alexander Johansen <57069715+Odyssey346@users.noreply.github.com> Date: Sun, 20 Jun 2021 14:27:33 +0200 Subject: [PATCH 2/6] fix GitHub spelling on about page (#1556) Signed-off-by: Oxygemo --- static/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/index.html b/static/index.html index 7d64cce0a..08132dc96 100644 --- a/static/index.html +++ b/static/index.html @@ -1682,7 +1682,7 @@ target="_blank" >
- Github + GitHub From f53ed4f5b41f4e323994c043324285ede63cd0e5 Mon Sep 17 00:00:00 2001 From: Miodec Date: Sun, 20 Jun 2021 14:54:29 +0100 Subject: [PATCH 3/6] fixed infinite loop when practising missed words. closes #1558 --- src/js/test/test-logic.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/js/test/test-logic.js b/src/js/test/test-logic.js index a8a6a4cf2..346ebc9a0 100644 --- a/src/js/test/test-logic.js +++ b/src/js/test/test-logic.js @@ -468,24 +468,24 @@ export async function init() { const previousWord = words.get(i - 1); const previousWord2 = words.get(i - 2); if ( - Config.mode == "custom" && - (CustomText.isWordRandom || CustomText.isTimeRandom) && - wordset.length < 3 - ) { - randomWord = wordset[Math.floor(Math.random() * wordset.length)]; - } else if ( Config.mode == "custom" && !CustomText.isWordRandom && !CustomText.isTimeRandom ) { randomWord = CustomText.text[i]; - } else { + } else if ( + Config.mode == "custom" && + (wordset.length < 3 || PractiseMissed.before.mode !== null) + ) { + randomWord = wordset[Math.floor(Math.random() * wordset.length)]; + } else { while ( randomWord == previousWord || randomWord == previousWord2 || (!Config.punctuation && randomWord == "I") || randomWord.indexOf(" ") > -1 ) { + console.log('rerandomising'); randomWord = wordset[Math.floor(Math.random() * wordset.length)]; } } From 0eac486bd6e57dd7763304ac297063f5f341f541 Mon Sep 17 00:00:00 2001 From: Miodec Date: Sun, 20 Jun 2021 15:16:53 +0100 Subject: [PATCH 4/6] fixed asynchronous langauge loading and getting to fix funboxes initially not working on the first load --- src/js/misc.js | 7 ++++--- src/js/test/caret.js | 4 ++-- src/js/test/funbox.js | 3 ++- src/js/test/test-logic.js | 6 +++--- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/js/misc.js b/src/js/misc.js index 02dfbee12..d641d14e4 100644 --- a/src/js/misc.js +++ b/src/js/misc.js @@ -1,4 +1,5 @@ import * as Loader from "./loader"; +import Config from "./config"; export function getuid() { console.error("Only share this uid with Miodec and nobody else!"); @@ -262,9 +263,9 @@ export function showNotification(text, time) { ); } -let currentLanguage = null; -export function getCurrentLanguage() { - return currentLanguage; +let currentLanguage; +export async function getCurrentLanguage() { + return await getLanguage(Config.language); } export async function getLanguage(lang) { diff --git a/src/js/test/caret.js b/src/js/test/caret.js index 7ab152dc4..23ac1d7fa 100644 --- a/src/js/test/caret.js +++ b/src/js/test/caret.js @@ -27,7 +27,7 @@ export function hide() { $("#caret").addClass("hidden"); } -export function updatePosition() { +export async function updatePosition() { if ($("#wordsWrapper").hasClass("hidden")) return; if ($("#caret").hasClass("off")) { return; @@ -56,7 +56,7 @@ export function updatePosition() { } if (Config.mode != "zen" && $(currentLetter).length == 0) return; - const isLanguageLeftToRight = Misc.getCurrentLanguage().leftToRight; + const isLanguageLeftToRight = await Misc.getCurrentLanguage().leftToRight; let currentLetterPosLeft = isLanguageLeftToRight ? currentLetter.offsetLeft : currentLetter.offsetLeft + $(currentLetter).width(); diff --git a/src/js/test/funbox.js b/src/js/test/funbox.js index cc249b8c9..89438535e 100644 --- a/src/js/test/funbox.js +++ b/src/js/test/funbox.js @@ -94,7 +94,8 @@ export async function activate(funbox) { if (funbox === undefined || funbox === null) { funbox = Config.funbox; } - if (Misc.getCurrentLanguage().ligatures) { + + if (await Misc.getCurrentLanguage().ligatures) { if (funbox == "choo_choo" || funbox == "earthquake") { Notifications.add( "Current language does not support this funbox mode", diff --git a/src/js/test/test-logic.js b/src/js/test/test-logic.js index 346ebc9a0..29a51ac4a 100644 --- a/src/js/test/test-logic.js +++ b/src/js/test/test-logic.js @@ -926,7 +926,7 @@ export function calculateWpmAndRaw() { }; } -export function addWord() { +export async function addWord() { let bound = 100; if (Config.funbox === "plus_one") bound = 1; if (Config.funbox === "plus_two") bound = 2; @@ -946,10 +946,10 @@ export function addWord() { return; const language = Config.mode !== "custom" - ? Misc.getCurrentLanguage() + ? await Misc.getCurrentLanguage() : { //borrow the direction of the current language - leftToRight: Misc.getCurrentLanguage().leftToRight, + leftToRight: await Misc.getCurrentLanguage().leftToRight, words: CustomText.text, }; const wordset = language.words; From dec3a6cb4f097a1180c09d54e6dc32bf5c02edce Mon Sep 17 00:00:00 2001 From: tinkoh Date: Sun, 20 Jun 2021 10:19:41 -0400 Subject: [PATCH 5/6] Fix typo in link (#1559) --- static/security-policy.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/security-policy.html b/static/security-policy.html index afa370951..56159e44c 100644 --- a/static/security-policy.html +++ b/static/security-policy.html @@ -96,7 +96,7 @@
  • - How to Disclose a Vulnearbility + How to Disclose a Vulnerability
  • Submission Guidelines
  • From fcbba25e557e54a932c46f59b6cd250518fee435 Mon Sep 17 00:00:00 2001 From: Miodec Date: Sun, 20 Jun 2021 15:35:45 +0100 Subject: [PATCH 6/6] i think this fixes the caret? --- src/js/test/caret.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/js/test/caret.js b/src/js/test/caret.js index 23ac1d7fa..81953ce8d 100644 --- a/src/js/test/caret.js +++ b/src/js/test/caret.js @@ -56,7 +56,8 @@ export async function updatePosition() { } if (Config.mode != "zen" && $(currentLetter).length == 0) return; - const isLanguageLeftToRight = await Misc.getCurrentLanguage().leftToRight; + const currentLanguage = await Misc.getCurrentLanguage(); + const isLanguageLeftToRight = currentLanguage.leftToRight; let currentLetterPosLeft = isLanguageLeftToRight ? currentLetter.offsetLeft : currentLetter.offsetLeft + $(currentLetter).width();