aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--frontend/src/ts/controllers/account-controller.ts6
-rw-r--r--frontend/src/ts/controllers/input-controller.ts6
-rw-r--r--frontend/src/ts/db.ts3
-rw-r--r--frontend/src/ts/ready.ts13
-rw-r--r--frontend/src/ts/test/test-timer.ts11
-rw-r--r--frontend/static/languages/_groups.json1
-rw-r--r--frontend/static/languages/_list.json1
-rw-r--r--frontend/static/languages/code_typst.json50
-rw-r--r--frontend/static/languages/polish_2k.json1
-rw-r--r--frontend/static/quotes/dutch.json24
-rw-r--r--frontend/static/quotes/english.json2
-rw-r--r--packages/contracts/src/users.ts2
12 files changed, 104 insertions, 16 deletions
diff --git a/frontend/src/ts/controllers/account-controller.ts b/frontend/src/ts/controllers/account-controller.ts
index 70191802c..c60b5d21e 100644
--- a/frontend/src/ts/controllers/account-controller.ts
+++ b/frontend/src/ts/controllers/account-controller.ts
@@ -48,6 +48,7 @@ import { navigate } from "./route-controller";
import { FirebaseError } from "firebase/app";
import * as PSA from "../elements/psa";
import defaultResultFilters from "../constants/default-result-filters";
+import { getActiveFunboxes } from "../test/funbox/list";
export const gmailProvider = new GoogleAuthProvider();
export const githubProvider = new GithubAuthProvider();
@@ -171,6 +172,11 @@ async function getDataAndInit(): Promise<boolean> {
);
await UpdateConfig.apply(snapshot.config);
UpdateConfig.saveFullConfigToLocalStorage(true);
+
+ //funboxes might be different and they wont activate on the account page
+ for (const fb of getActiveFunboxes()) {
+ fb.functions?.applyGlobalCSS?.();
+ }
}
AccountButton.loading(false);
TagController.loadActiveFromLocalStorage();
diff --git a/frontend/src/ts/controllers/input-controller.ts b/frontend/src/ts/controllers/input-controller.ts
index dcb263ca9..50a7c8bc4 100644
--- a/frontend/src/ts/controllers/input-controller.ts
+++ b/frontend/src/ts/controllers/input-controller.ts
@@ -425,12 +425,14 @@ function isCharCorrect(char: string, charIndex: number): boolean {
char === "‘" ||
char === "'" ||
char === "ʼ" ||
- char === "׳") &&
+ char === "׳" ||
+ char === "ʻ") &&
(originalChar === "’" ||
originalChar === "‘" ||
originalChar === "'" ||
originalChar === "ʼ" ||
- originalChar === "׳")
+ originalChar === "׳" ||
+ originalChar === "ʻ")
) {
return true;
}
diff --git a/frontend/src/ts/db.ts b/frontend/src/ts/db.ts
index ff437e07f..8accd57c2 100644
--- a/frontend/src/ts/db.ts
+++ b/frontend/src/ts/db.ts
@@ -372,6 +372,9 @@ export async function getUserResults(offset?: number): Promise<boolean> {
return false;
}
+ //another check in case user logs out while waiting for response
+ if (!isAuthenticated()) return false;
+
const results: SnapshotResult<Mode>[] = response.body.data.map((result) => {
if (result.bailedOut === undefined) result.bailedOut = false;
if (result.blindMode === undefined) result.blindMode = false;
diff --git a/frontend/src/ts/ready.ts b/frontend/src/ts/ready.ts
index e1b923688..695c82478 100644
--- a/frontend/src/ts/ready.ts
+++ b/frontend/src/ts/ready.ts
@@ -8,8 +8,10 @@ import * as AccountButton from "./elements/account-button";
import Konami from "konami";
import * as ServerConfiguration from "./ape/server-configuration";
import { getActiveFunboxes } from "./test/funbox/list";
+import { loadPromise } from "./config";
-$((): void => {
+$(async (): Promise<void> => {
+ await loadPromise;
Misc.loadCSS("/css/slimselect.min.css", true);
Misc.loadCSS("/css/balloon.min.css", true);
@@ -19,11 +21,10 @@ $((): void => {
//to make sure the initial theme application doesnt animate the background color
$("body").css("transition", "background .25s, transform .05s");
MerchBanner.showIfNotClosedBefore();
- setTimeout(() => {
- for (const fb of getActiveFunboxes()) {
- fb.functions?.applyGlobalCSS?.();
- }
- }, 500); //this approach will probably bite me in the ass at some point
+
+ for (const fb of getActiveFunboxes()) {
+ fb.functions?.applyGlobalCSS?.();
+ }
$("#app")
.css("opacity", "0")
diff --git a/frontend/src/ts/test/test-timer.ts b/frontend/src/ts/test/test-timer.ts
index 1cbf5e19f..e8ba4416d 100644
--- a/frontend/src/ts/test/test-timer.ts
+++ b/frontend/src/ts/test/test-timer.ts
@@ -129,7 +129,7 @@ function layoutfluid(): void {
function checkIfFailed(
wpmAndRaw: { wpm: number; raw: number },
acc: number
-): void {
+): boolean {
if (timerDebug) console.time("fail conditions");
TestInput.pushKeypressesToHistory();
TestInput.pushErrorToHistory();
@@ -143,16 +143,17 @@ function checkIfFailed(
SlowTimer.clear();
slowTimerCount = 0;
TimerEvent.dispatch("fail", "min speed");
- return;
+ return true;
}
if (Config.minAcc === "custom" && acc < Config.minAccCustom) {
if (timer !== null) clearTimeout(timer);
SlowTimer.clear();
slowTimerCount = 0;
TimerEvent.dispatch("fail", "min accuracy");
- return;
+ return true;
}
if (timerDebug) console.timeEnd("fail conditions");
+ return false;
}
function checkIfTimeIsUp(): void {
@@ -200,8 +201,8 @@ async function timerStep(): Promise<void> {
const acc = calculateAcc();
monkey(wpmAndRaw);
layoutfluid();
- checkIfFailed(wpmAndRaw, acc);
- checkIfTimeIsUp();
+ const failed = checkIfFailed(wpmAndRaw, acc);
+ if (!failed) checkIfTimeIsUp();
if (timerDebug) console.timeEnd("timer step -----------------------------");
}
diff --git a/frontend/static/languages/_groups.json b/frontend/static/languages/_groups.json
index 6335a4790..512b259e1 100644
--- a/frontend/static/languages/_groups.json
+++ b/frontend/static/languages/_groups.json
@@ -606,6 +606,7 @@
"code_lua",
"code_luau",
"code_latex",
+ "code_typst",
"code_matlab",
"code_sql",
"code_perl",
diff --git a/frontend/static/languages/_list.json b/frontend/static/languages/_list.json
index c6b02836b..460cfbd13 100644
--- a/frontend/static/languages/_list.json
+++ b/frontend/static/languages/_list.json
@@ -339,6 +339,7 @@
,"code_lua"
,"code_luau"
,"code_latex"
+ ,"code_typst"
,"code_matlab"
,"code_sql"
,"code_perl"
diff --git a/frontend/static/languages/code_typst.json b/frontend/static/languages/code_typst.json
new file mode 100644
index 000000000..bd9f85323
--- /dev/null
+++ b/frontend/static/languages/code_typst.json
@@ -0,0 +1,50 @@
+{
+ "name": "code_typst",
+ "noLazyMode": true,
+ "ligatures": false,
+ "words": [
+ "#use",
+ "#set par(justify: true)",
+ "#show",
+ "#set",
+ "#let",
+ "#par",
+ "#figure",
+ "#underline",
+ "#smallcaps",
+ "#grid",
+ "#box",
+ "#place",
+ "#import",
+ "#link",
+ "#lorem(50)",
+ "let",
+ "#{",
+ "}",
+ "#(",
+ ")",
+ "#[",
+ "]",
+ "$",
+ "@",
+ "*",
+ "-",
+ "_",
+ "\\",
+ "/",
+ "//",
+ "floor(x)",
+ "cal(A)",
+ "NN",
+ "RR",
+ ">",
+ "<",
+ ">=",
+ "gt.eq.not",
+ "sum_(k=1)^oo",
+ "pi",
+ "&=",
+ "vec",
+ "mat"
+ ]
+}
diff --git a/frontend/static/languages/polish_2k.json b/frontend/static/languages/polish_2k.json
index e004e46d8..3eba85e53 100644
--- a/frontend/static/languages/polish_2k.json
+++ b/frontend/static/languages/polish_2k.json
@@ -2039,7 +2039,6 @@
"Bóg",
"wybrać",
"zjawisko",
- "abugida",
"według",
"kara",
"czas",
diff --git a/frontend/static/quotes/dutch.json b/frontend/static/quotes/dutch.json
index bc716cd88..fad54d712 100644
--- a/frontend/static/quotes/dutch.json
+++ b/frontend/static/quotes/dutch.json
@@ -396,6 +396,30 @@
"source": "Etty Hillesum",
"length": 95,
"id": 65
+ },
+ {
+ "text": "Geef al uw geld aan de arme mensen... als zij hetzelfde doen heb je het morgen misschien al terug.",
+ "source": "Herman Brusselmans",
+ "length": 98,
+ "id": 66
+ },
+ {
+ "text": "Schrap het woord 'ik' uit het taalgebruik en de hele mensheid staat met de mond vol tanden en het paniekzweet op het voorhoofd.",
+ "source": "Herman Brusselmans",
+ "length": 127,
+ "id": 67
+ },
+ {
+ "text": "Een James Bond-boek is stom maar opwindend, terwijl een meesterwerk van de Vlaamse literatuur even stom maar daarbij ook nog vervelend is.",
+ "source": "Louis Paul Boon",
+ "length": 138,
+ "id": 68
+ },
+ {
+ "text": "Ik ben absoluut tegen de puurheid van de taal. Als het iets wezenlijks meebrengt, moet je anglicismen, germanismen en gallicismen meteen cultiveren. Ik geloof niet in het uitgedunde, dat men voorhoudt als het enige Nederlands, ik irriteer me aan de Nederlandse overheersing.",
+ "source": "Hugo Claus",
+ "length": 274,
+ "id": 69
}
]
}
diff --git a/frontend/static/quotes/english.json b/frontend/static/quotes/english.json
index 202b69bd2..28a20306c 100644
--- a/frontend/static/quotes/english.json
+++ b/frontend/static/quotes/english.json
@@ -1094,7 +1094,7 @@
"length": 204
},
{
- "text": "There are mysteries to the universe we were never meant to solve, but who we are and why we are here, are not among them, those answers we carry inside.",
+ "text": "There are mysteries to the universe we were never meant to solve. But who we are and why we are here, are not among them. Those answers we carry inside.",
"source": "Transformers: Age of Extinction",
"id": 192,
"length": 152
diff --git a/packages/contracts/src/users.ts b/packages/contracts/src/users.ts
index 4a835284e..498f8af62 100644
--- a/packages/contracts/src/users.ts
+++ b/packages/contracts/src/users.ts
@@ -45,7 +45,7 @@ export const UserNameSchema = doesNotContainProfanity(
.max(16)
.regex(
/^[\da-zA-Z_-]+$/,
- "Can only contain lower/uppercase letters, underscare and minus."
+ "Can only contain lower/uppercase letters, underscore and minus."
)
);