From ec0478efb737ed485fa27df14e0d6109280976e9 Mon Sep 17 00:00:00 2001 From: Christian Fehmer Date: Mon, 30 Mar 2026 16:14:40 +0200 Subject: [PATCH 1/5] fix(profile): fix profile not shown if inventory is null (@fehmer) (#7745) --- .../components/common/AsyncContent.spec.tsx | 13 ++++++++++++- frontend/src/ts/components/common/AsyncContent.tsx | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/frontend/__tests__/components/common/AsyncContent.spec.tsx b/frontend/__tests__/components/common/AsyncContent.spec.tsx index d23692e1a427..6902b670d586 100644 --- a/frontend/__tests__/components/common/AsyncContent.spec.tsx +++ b/frontend/__tests__/components/common/AsyncContent.spec.tsx @@ -56,6 +56,17 @@ describe("AsyncContent", () => { expect(preloader).not.toBeInTheDocument(); }); + it("renders on resolve with object containing null", async () => { + const { container } = renderWithQuery({ + result: { text: "Test Data", extra: null } as any, + }); + + await waitFor(() => { + expect(screen.getByTestId("content")).toBeVisible(); + }); + expect(container.innerHTML).toContain("static content"); + }); + it("renders default error message on fail", async () => { const error = new Error("Test error"); renderWithQuery({ result: error }); @@ -152,7 +163,7 @@ describe("AsyncContent", () => { )}> {(data: string | undefined) => ( <> - foo + static content no data}>
{data}
diff --git a/frontend/src/ts/components/common/AsyncContent.tsx b/frontend/src/ts/components/common/AsyncContent.tsx index 947854c28bd6..45c65fbab2b3 100644 --- a/frontend/src/ts/components/common/AsyncContent.tsx +++ b/frontend/src/ts/components/common/AsyncContent.tsx @@ -124,6 +124,7 @@ export default function AsyncContent( if (data === undefined || data === null) { return false; } + if ("defaultQuery" in source()) return true; return Object.values(data).every((v) => v !== undefined && v !== null); }; From ca84f790e68141789d43448111427aaafe9a5eb5 Mon Sep 17 00:00:00 2001 From: Seif Soliman Date: Mon, 30 Mar 2026 16:15:48 +0200 Subject: [PATCH 2/5] fix(quote-modal): broken debouncing & prevent filter reset on chaining (@byseif21) (#7742) --- .../ts/components/modals/QuoteSearchModal.tsx | 34 +++++++++++-------- frontend/src/ts/hooks/effects.ts | 3 +- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/frontend/src/ts/components/modals/QuoteSearchModal.tsx b/frontend/src/ts/components/modals/QuoteSearchModal.tsx index 5cbd83f36890..264a52cfa041 100644 --- a/frontend/src/ts/components/modals/QuoteSearchModal.tsx +++ b/frontend/src/ts/components/modals/QuoteSearchModal.tsx @@ -7,7 +7,6 @@ import { Show, on, } from "solid-js"; -import { debounce } from "throttle-debounce"; import Ape from "../../ape"; import { setConfig } from "../../config/setters"; @@ -15,6 +14,7 @@ import { Config } from "../../config/store"; import { isCaptchaAvailable } from "../../controllers/captcha-controller"; import QuotesController, { Quote } from "../../controllers/quotes-controller"; import * as DB from "../../db"; +import { createDebouncedEffectOn } from "../../hooks/effects"; import { isLoggedIn } from "../../states/core"; import { hideLoaderBar, showLoaderBar } from "../../states/loader-bar"; import { @@ -32,6 +32,7 @@ import * as TestLogic from "../../test/test-logic"; import * as TestState from "../../test/test-state"; import { cn } from "../../utils/cn"; import { getLanguage } from "../../utils/json-data"; +import * as Misc from "../../utils/misc"; import { buildSearchService, SearchService, @@ -78,7 +79,7 @@ function exactSearch(quotes: Quote[], captured: RegExp[]): [Quote[], string[]] { noMatch = true; break; } - currentMatches.push(RegExp.escape(match[0])); + currentMatches.push(Misc.escapeRegExp(match[0])); } if (!noMatch) { @@ -216,10 +217,16 @@ export function QuoteSearchModal(): JSXElement { const [isRtl, setIsRtl] = createSignal(false); const [favVersion, setFavVersion] = createSignal(0); - const debouncedSearch = debounce(250, (text: string) => { - setCurrentPage(1); - performSearch(text); - }); + const [searchText, setSearchText] = createSignal(""); + createDebouncedEffectOn( + 250, + searchText, + (text) => { + setCurrentPage(1); + performSearch(text); + }, + { defer: true }, + ); const isOpen = (): boolean => isModalOpen("QuoteSearch"); @@ -255,7 +262,7 @@ export function QuoteSearchModal(): JSXElement { if (exactSearchQueries[0]) { const searchQueriesRaw = exactSearchQueries.map( - (query) => new RegExp(RegExp.escape(query[1] ?? ""), "i"), + (query) => new RegExp(Misc.escapeRegExp(query[1] ?? ""), "i"), ); [exactSearchMatches, exactSearchMatchedQueryTerms] = exactSearch( allQuotes, @@ -364,8 +371,10 @@ export function QuoteSearchModal(): JSXElement { }), ); - const handleBeforeShow = (): void => { + const handleBeforeShow = (isChained: boolean): void => { + if (isChained) return; form.reset(); + setSearchText(""); setCurrentPage(1); setLengthFilter([]); setShowFavoritesOnly(false); @@ -379,7 +388,7 @@ export function QuoteSearchModal(): JSXElement { Config.language, ); setQuotes(fetchedQuotes); - performSearch(""); + performSearch(form.state.values.searchText); }; const applyQuote = (quoteId: number): void => { @@ -438,17 +447,12 @@ export function QuoteSearchModal(): JSXElement { showModal("QuoteSubmit"); }; - const handleBeforeHide = (): void => { - debouncedSearch.cancel(); - }; - return ( <> @@ -477,7 +481,7 @@ export function QuoteSearchModal(): JSXElement { listeners={{ onChange: ({ value }) => { if (!isOpen()) return; - debouncedSearch(value); + setSearchText(value); }, }} children={(field) => ( diff --git a/frontend/src/ts/hooks/effects.ts b/frontend/src/ts/hooks/effects.ts index dfee2e45e72e..802375ac6bcc 100644 --- a/frontend/src/ts/hooks/effects.ts +++ b/frontend/src/ts/hooks/effects.ts @@ -1,4 +1,4 @@ -import { createEffect, on } from "solid-js"; +import { createEffect, on, onCleanup } from "solid-js"; import { debounce } from "throttle-debounce"; type Accessor = () => T; @@ -33,6 +33,7 @@ export function createDebouncedEffectOn< debounceOptions: { atBegin?: boolean } = {}, ): void { const debouncedFn = debounce(delay, fn, debounceOptions); + onCleanup(() => debouncedFn.cancel()); //@ts-expect-error huh? createEffect(on(deps as unknown, debouncedFn as unknown, options)); } From 11deba4754ee75428dc331f2948844a66f976aa3 Mon Sep 17 00:00:00 2001 From: Miodec Date: Mon, 30 Mar 2026 16:19:31 +0200 Subject: [PATCH 3/5] chore: release v26.14.0 --- frontend/static/contributors.json | 110 ++++++++++++++++-------------- package.json | 2 +- 2 files changed, 58 insertions(+), 54 deletions(-) diff --git a/frontend/static/contributors.json b/frontend/static/contributors.json index 200727fc76dc..62a0dbd2651e 100644 --- a/frontend/static/contributors.json +++ b/frontend/static/contributors.json @@ -24,28 +24,29 @@ "aNOOBisTheGod", "sanidhyas3s", "CrumblyLiquid", - "DharmarajX24", "a1usha", - "0x8b", - "corey-b", + "DharmarajX24", "jnoel-dev", - "seaerchin", - "tajhans", + "corey-b", + "0x8b", "Dmskrzh", + "tajhans", + "seaerchin", "s3rdarb", "Smithster", "Killer8Hyper", - "OctahedronV2", - "albertying", - "refact0r", - "decaf", "teomac", "Ryan Harrington", - "DanGonite57", + "decaf", + "refact0r", + "OctahedronV2", + "albertying", + "aviiciii", + "norwd", + "Marco-Pagani", "Jack92829", + "DanGonite57", "Maclogger", - "Marco-Pagani", - "aviiciii", "bataak", "ibrab000", "egorguslyan", @@ -94,11 +95,11 @@ "corey", "barthakstege", "ademirkan", - "norwd", "vuong-buihv", "eth0fox", "Shuja-Mahmood", "itsmeshibintmz", + "D3press3dd", "l4ssc", "psq4", "shishberg", @@ -109,7 +110,6 @@ "thienanbeou", "anakojm", "ObiKeahloa", - "D3press3dd", "AnnaBuchholz", "Ahmad-A0", "Adawd", @@ -131,7 +131,7 @@ "finnlestrange", "Dioswilson", "raaid3", - "kiriDevs", + "tmuplayer33", "angularorbit", "amarnathsama", "alegottu", @@ -147,9 +147,9 @@ "ryurina", "Ranel Padon", "Henning Meyer", - "tmuplayer33", "egemasta", "den1kon", + "kiriDevs", "aqeelshamz", "thedev0ps", "zefr0x", @@ -175,12 +175,12 @@ "ArijanJ", "AntoninMayet", "kae", - "Abod1960", + "Abdulbasit0123", "avetisovi", + "Abod1960", "underscoore", - "iitsalex", "Alexander Johansen", - "Abdulbasit0123", + "iitsalex", "MushyToast", "MichaelDeutschCoding", "prince-patel23", @@ -199,11 +199,10 @@ "Joshua Odeyemi", "kunal-rp", "kacperwyczawski", - "SarkarKurdish", "sashinexists", - "Samunals", - "SameerJS6", "satnaing", + "SarkarKurdish", + "Samunals", "scarcekoi", "shanedonovan", "Shashwat-pd", @@ -219,7 +218,7 @@ "tjkuson", "Typeacode", "turkwr", - "266-750Balloons", + "VNKTSH00", "mendelmaleh", "michelkoga", "mohanadft", @@ -242,7 +241,8 @@ "Rodrigo Chireia", "ryan-harrington", "Ryrden", - "VNKTSH00", + "SameerJS6", + "openvaibhav", "joshuamango", "kStor2poche", "kopipahit-1", @@ -265,7 +265,6 @@ "yekta", "rurude", "AndrejStojkovic", - "openvaibhav", "va1orance", "vilgotf", "vilvl", @@ -280,6 +279,7 @@ "boessu", "carnivoroustoad", "coliss86", + "damarpas", "compscitwilight", "druotoni", "ebblies", @@ -287,6 +287,7 @@ "hanabo-mk", "holoflash", "jirmu", + "266-750Balloons", "Omaeda", "bsamseth", "bsule", @@ -375,6 +376,7 @@ "ianfromdover", "gkeep", "desert3agle", + "Paras Arya", "Spurk", "Steve H", "Stiaan Nel", @@ -439,6 +441,7 @@ "Xudong Zheng", "Xydez", "Yaroslav Smirnov", + "Yohaan Narayanan", "Young Shung", "YuxOfficial", "Zach Brehm", @@ -446,7 +449,6 @@ "Zach Tepper", "Zanin Andrea", "Zarrten", - "Zeal Patel", "Tobi", "Tobias Kendlbacher", "Tobin Richard", @@ -495,7 +497,7 @@ "ProBottler", "Provola23", "Punit Bhesota", - "Ronnapat Srivoravilai", + "Connor Goldberg", "Noah", "Noah K", "Nolan Karjala", @@ -520,7 +522,7 @@ "PS-PARSA", "PTLux1517", "Pablo Sánchez Flores", - "Paras Arya", + "Ronnapat Srivoravilai", "Ronnapatp", "Rowan Monk", "Ruan Buhr", @@ -568,6 +570,7 @@ "Rodolfo Velázquez", "Rohit Kumar Saini", "Roj", + "mufasachan", "myakinx", "neinja", "net-tech-", @@ -592,7 +595,7 @@ "riso", "robi-wan", "root", - "usrme", + "ba1man", "kokaloo", "krau5", "large_r0dent", @@ -616,7 +619,7 @@ "mokshsinghji", "montydrei", "mqdr", - "mufasachan", + "usrme", "vermoot", "vetu11", "wclxb", @@ -673,6 +676,7 @@ "bilfri", "bitt4", "blue-94", + "blueberry", "butterflycup", "bvoo", "ccenturionn", @@ -686,10 +690,9 @@ "codemurt", "connermcnicholas", "cute-catgirl", - "damarpas", "dankuri", "dasle52", - "hakujitsu", + "Zeal Patel", "Zephyr Jones", "Zev Ross", "Ziyodulla Muydinjanov", @@ -713,7 +716,7 @@ "aoieop", "arthur", "ashharrrrr", - "ba1man", + "hakujitsu", "hikettei", "hossammenem", "howmanysmall", @@ -761,7 +764,6 @@ "gkaply532", "grigoriynikolaev", "gwenzek", - "Connor Goldberg", "CoolenL", "Copilot", "Cory Shaw", @@ -784,8 +786,8 @@ "Danish arora", "Darryl Brooks", "DastardlySky", - "Edward Huang", - "Binekrasik", + "David Kosorin", + "akhilesh-w", "Biplav Barua", "Boris Gubanov", "Boris Nezlobin", @@ -833,7 +835,7 @@ "Francis Eugene Casibu", "Frederick (Kyu Won) Kim", "Frederick Kim", - "David Kosorin", + "Fynn", "David Mordechai", "Dean Scarff", "Decipher-CS", @@ -857,7 +859,7 @@ "Eduard Stefanescu", "Eduardo Guzman-Diaz", "Eduardo Paul", - "akhilesh-w", + "Edward Huang", "Akuna444", "AlJavhar", "Ale-Flash", @@ -881,7 +883,7 @@ "radarmeanie", "Andreas", "A9qx", - "ashinberish", + "AndreiSergiuu", "100daysummer", "28Zapper", "47th", @@ -908,7 +910,7 @@ "ajay-vishnu", "ashiqr-dev", "asifMalik78", - "agokule", + "Atharv Gokule", "Aurimas Anskaitis", "Avick Saha", "Axel Cuevas", @@ -930,7 +932,7 @@ "Benjamin Meixner", "Besnik Bleta", "Bianco Da Costa Oliveira", - "AndreiSergiuu", + "Binekrasik", "andrewhchang", "Hg0wl", "aadcg", @@ -955,12 +957,13 @@ "Arom1a", "AronF", "Arthur Nunes", - "Lindsey Peterson", + "ashinberish", "Lobsang Norbu", "Lodun Coombs", "Long Nguyen", "Lorenz De Robles", "Luis Casas", + "Luis Woo", "Lukas", "Luke Nguyen Khanh", "Lumid", @@ -979,9 +982,7 @@ "Mark Stosberg", "Marken Foo", "Martin", - "Mohit Paddhariya", - "Kamar", - "KanatFM", + "HasanTheSyrian", "Katrina Lou S. Tantay", "Kavin Ruengprateepsang", "Kazeno", @@ -1004,6 +1005,7 @@ "Lev Shumilov", "Liande Guo", "Liewe Gutter", + "Lindsey Peterson", "Moilleadoir", "MordecaiO", "MrEgggga", @@ -1016,6 +1018,7 @@ "NaeNate", "Nat Zimmermann", "Nathan Thomson", + "Nay Lin", "Neeraj TK", "NeoNyaa", "NeraShi", @@ -1051,8 +1054,7 @@ "Ming", "Mirek Kudinoff", "Mohanad Alrwaihy", - "Haruki Jay Shimada", - "HasanTheSyrian", + "Mohit Paddhariya", "Hector Queiróz", "Helder Barboza", "Hemram Kumarapu", @@ -1075,8 +1077,8 @@ "Invades", "Ion Pascari", "Isaac Howie", - "Joel Tony", - "Fynn", + "István Korompai", + "ItsDrike", "Gabriel Fleury", "Gabriel Ruiz Pérez", "Gabriel Santana Paredes", @@ -1101,6 +1103,7 @@ "HariramakrishnanK", "Harry Hopkinson", "Harsh Natuskar", + "Haruki Jay Shimada", "Johan de Jongh", "Johan le stickman", "Jonathan Frech", @@ -1124,8 +1127,8 @@ "K0stov", "Kaden Scott", "Kael", - "István Korompai", - "ItsDrike", + "Kamar", + "KanatFM", "Ivaylo Ivanov", "Ivek", "J3ikar", @@ -1147,5 +1150,6 @@ "Jeremy Gautama", "Jeroen Meijer (Jay)", "Jierie Ezequiel Jacla", - "Joel Bradshaw" -] + "Joel Bradshaw", + "Joel Tony" +] \ No newline at end of file diff --git a/package.json b/package.json index 97972f8961d8..a8c55552ac5e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "monkeytype", - "version": "26.12.0", + "version": "26.14.0", "private": true, "license": "GPL-3.0", "type": "module", From 75ba4aa3dad770077fff196006ff96f7d0979de2 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Mon, 30 Mar 2026 16:27:12 +0200 Subject: [PATCH 4/5] refactor: remove firebase `isAuthenticated`, rename `isLoggedIn` to `isAuthenticated` (@copilot) (#7738) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Description Two overlapping auth-check functions existed: `firebase.isAuthenticated()` (checked `Auth.currentUser`) and `states/core.isLoggedIn()` (checked reactive `getUserId()` signal). Consolidating to one canonical function backed by the reactive state. **Changes:** - `states/core.ts`: renamed `isLoggedIn` → `isAuthenticated` - `firebase.ts`: removed `isAuthenticated` export - All ~35 call-sites updated to import `isAuthenticated` from `states/core` instead of `firebase` - `mock-firebase.ts`: removed now-defunct `isAuthenticated` mock entry ### Checks - [ ] Adding quotes? - Make sure to follow the [quotes documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/QUOTES.md) - [ ] Make sure to include translations for the quotes in the description (or another comment) so we can verify their content. - [ ] Adding a language? - Make sure to follow the [languages documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/LANGUAGES.md) - [ ] Add language to `packages/schemas/src/languages.ts` - [ ] Add language to exactly one group in `frontend/src/ts/constants/languages.ts` - [ ] Add language json file to `frontend/static/languages` - [ ] Adding a theme? - Make sure to follow the [themes documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/THEMES.md) - [ ] Add theme to `packages/schemas/src/themes.ts` - [ ] Add theme to `frontend/src/ts/constants/themes.ts` - [ ] (optional) Add theme css file to `frontend/static/themes` - [ ] Add some screenshots of the theme, especially with different test settings (colorful, flip colors) to your pull request - [ ] Adding a layout? - [ ] Make sure to follow the [layouts documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/LAYOUTS.md) - [ ] Add layout to `packages/schemas/src/layouts.ts` - [ ] Add layout json file to `frontend/static/layouts` - [ ] Adding a font? - Make sure to follow the [fonts documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/FONTS.md) - [ ] Add font file to `frontend/static/webfonts` - [ ] Add font to `packages/schemas/src/fonts.ts` - [ ] Add font to `frontend/src/ts/constants/fonts.ts` - [ ] Check if any open issues are related to this PR; if so, be sure to tag them below. - [ ] Make sure the PR title follows the Conventional Commits standard. (https://www.conventionalcommits.org for more info) - [ ] Make sure to include your GitHub username prefixed with @ inside parentheses at the end of the PR title. > [!WARNING] > >
> Firewall rules blocked me from connecting to one or more addresses (expand for details) > > #### I tried to connect to the following addresses, but was blocked by firewall rules: > > - `iojs.org` > - Triggering command: `/usr/bin/curl curl -q --fail --compressed -L -s REDACTED -o - che/node-gyp/24.-c` (dns block) > - Triggering command: `/usr/bin/curl curl -q --fail --compressed -L -s REDACTED -o - --global de/node/bin/sh make tage -C build cal/share/pnpm/./home/REDACTED/work/monkeytype/monkeytype/frontend/src/ts/collections/inbox.ts 4 --global ules/.bin/uname uname` (dns block) > - Triggering command: `/usr/bin/curl curl -q --fail --compressed -L -s REDACTED -o - k/monkeytype/monrev-parse k/monkeytype/monHEAD k/monkeytype/monkeytype/frontend/src/ts/componenstash k/mo d/src/ts/commandline/lists.ts k/monkeytype/monkeytype/frontend/src/ts/componen--message e_modules/.bin/node che/node-gyp/24.git` (dns block) > > If you need me to access, download, or install something from one of these locations, you can either: > > - Configure [Actions setup steps](https://gh.io/copilot/actions-setup-steps) to set up my environment, which run before the firewall is enabled > - Add the appropriate URLs or hosts to the custom allowlist in this repository's [Copilot coding agent settings](https://github.com/monkeytypegame/monkeytype/settings/copilot/coding_agent) (admins only) > >
Original prompt > 1. Remove the `isAuthenticated` function/variable from the codebase by locating its definition and all references to it. > 2. Rename all occurrences of `isLoggedIn` to `isAuthenticated`, including its definition, usages, and any imports/exports where applicable. > 3. Ensure that all relevant files are updated accordingly to reflect these changes. > 4. Test and verify that the changes do not introduce any errors or inconsistencies in the application. > > The following is the prior conversation context from the user's chat exploration (may be truncated): > > User: Currently we have isloggedin and isauthenticated. Remove isauthenticated, rename is loggedin to isauthenticated, update usage > > Assistant: To address this request: > > 1. **Remove `isAuthenticated` from the codebase.** > - You need to find and delete the definition and usages of the `isAuthenticated` function/variable. > > 2. **Rename `isLoggedIn` to `isAuthenticated`.** > - Update the definition and refactor all occurrences of `isLoggedIn` to `isAuthenticated`. > > 3. **Ensure consistent updates across the codebase.** > - Review imports and usages in other files to make sure the naming change is fully reflected. > > Would you like me to make these changes directly in a specific repository or provide a list of steps you can follow to implement them? Let me know if additional details or automation support is needed. > > User: Monkeytype repo > > Assistant: To make the requested changes in the Monkeytype repository: > > 1. **Remove `isAuthenticated`:** > - Identify all definitions and usages of `isAuthenticated` and remove them from the codebase. > > 2. **Rename `isLoggedIn` to `isAuthenticated`:** > - Rename the `isLoggedIn` function/variable to `isAuthenticated` and update all references accordingly. > > Would you like me to implement these changes directly via a pull request in the Monkeytype repository? If yes, please confirm the repository information (`owner/repo`), or let me know if you need me to generate a plan instead. > > User: Monkeytypegame/monkeytype > > Assistant: A pull request has been initiated to make the requested changes in the Monkeytypegame/monkeytype repository. Let me know if you need further updates or adjustments! > >
*This pull request was created from Copilot chat.* > --- ✨ Let Copilot coding agent [set things up for you](https://github.com/monkeytypegame/monkeytype/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Jack --- frontend/__tests__/__harness__/mock-firebase.ts | 1 - frontend/src/ts/ape/config.ts | 2 +- frontend/src/ts/auth.tsx | 2 +- frontend/src/ts/collections/inbox.ts | 4 ++-- frontend/src/ts/commandline/commandline-metadata.ts | 4 ++-- frontend/src/ts/commandline/lists.ts | 3 ++- frontend/src/ts/commandline/lists/custom-themes-list.ts | 2 +- frontend/src/ts/commandline/lists/navigation.ts | 2 +- frontend/src/ts/commandline/lists/presets.ts | 2 +- frontend/src/ts/commandline/lists/quote-favorites.ts | 2 +- frontend/src/ts/commandline/lists/tags.ts | 2 +- .../src/ts/components/common/anime/AnimeConditional.tsx | 2 +- .../src/ts/components/layout/footer/ThemeIndicator.tsx | 2 +- .../src/ts/components/modals/MobileTestConfigModal.tsx | 4 ++-- frontend/src/ts/components/modals/QuoteSearchModal.tsx | 8 ++++---- .../ts/components/pages/leaderboard/LeaderboardPage.tsx | 6 +++--- frontend/src/ts/components/pages/leaderboard/Sidebar.tsx | 4 ++-- frontend/src/ts/components/pages/profile/UserDetails.tsx | 4 ++-- frontend/src/ts/components/pages/test/TestConfig.tsx | 4 ++-- frontend/src/ts/config/metadata.ts | 2 +- frontend/src/ts/controllers/route-controller.ts | 3 ++- frontend/src/ts/db.ts | 3 ++- .../src/ts/elements/account-settings/ape-key-table.ts | 2 +- .../ts/elements/account-settings/blocked-user-table.ts | 2 +- frontend/src/ts/elements/modes-notice.ts | 2 +- frontend/src/ts/elements/settings/theme-picker.ts | 3 +-- frontend/src/ts/event-handlers/account.ts | 2 +- frontend/src/ts/firebase.ts | 4 ---- frontend/src/ts/modals/simple-modals.ts | 7 ++----- frontend/src/ts/modals/user-report.ts | 2 +- frontend/src/ts/pages/account-settings.ts | 4 ++-- frontend/src/ts/pages/settings.ts | 3 +-- frontend/src/ts/queries/index.ts | 4 ++-- frontend/src/ts/states/core.ts | 2 +- frontend/src/ts/test/result.ts | 2 +- frontend/src/ts/test/test-logic.ts | 4 ++-- frontend/src/ts/test/test-screenshot.ts | 7 +++++-- frontend/static/contributors.json | 2 +- 38 files changed, 58 insertions(+), 62 deletions(-) diff --git a/frontend/__tests__/__harness__/mock-firebase.ts b/frontend/__tests__/__harness__/mock-firebase.ts index b445c2b1979a..0c3811a591bc 100644 --- a/frontend/__tests__/__harness__/mock-firebase.ts +++ b/frontend/__tests__/__harness__/mock-firebase.ts @@ -2,5 +2,4 @@ import { vi } from "vitest"; vi.mock("../../src/ts/firebase", () => ({ app: undefined, Auth: undefined, - isAuthenticated: () => false, })); diff --git a/frontend/src/ts/ape/config.ts b/frontend/src/ts/ape/config.ts index 7bc1402587db..9e12b98e142c 100644 --- a/frontend/src/ts/ape/config.ts +++ b/frontend/src/ts/ape/config.ts @@ -1,5 +1,5 @@ import { Config } from "@monkeytype/schemas/configs"; -import { isAuthenticated } from "../firebase"; +import { isAuthenticated } from "../states/core"; import { showErrorNotification } from "../states/notifications"; import Ape from "."; diff --git a/frontend/src/ts/auth.tsx b/frontend/src/ts/auth.tsx index 972b61ff07d7..01939173ae07 100644 --- a/frontend/src/ts/auth.tsx +++ b/frontend/src/ts/auth.tsx @@ -15,7 +15,6 @@ import { authEvent } from "./events/auth"; import { isAuthAvailable, getAuthenticatedUser, - isAuthenticated, signOut as authSignOut, signInWithEmailAndPassword, createUserWithEmailAndPassword, @@ -23,6 +22,7 @@ import { resetIgnoreAuthCallback, } from "./firebase"; import * as Sentry from "./sentry"; +import { isAuthenticated } from "./states/core"; import { showLoaderBar, hideLoaderBar } from "./states/loader-bar"; import { showNoticeNotification, diff --git a/frontend/src/ts/collections/inbox.ts b/frontend/src/ts/collections/inbox.ts index 4ca003694493..398068daebdc 100644 --- a/frontend/src/ts/collections/inbox.ts +++ b/frontend/src/ts/collections/inbox.ts @@ -11,7 +11,7 @@ import { Accessor, createSignal } from "solid-js"; import Ape from "../ape"; import { queryClient } from "../queries"; import { baseKey } from "../queries/utils/keys"; -import { isLoggedIn } from "../states/core"; +import { isAuthenticated } from "../states/core"; import { flushDebounceStrategy } from "./utils/flushDebounceStrategy"; import { showErrorNotification } from "../states/notifications"; @@ -92,7 +92,7 @@ export async function flushPendingChanges({ // oxlint-disable-next-line typescript/explicit-function-return-type export function useInboxQuery(enabled: Accessor) { return useLiveQuery((q) => { - if (!isLoggedIn() || !enabled()) return undefined; + if (!isAuthenticated() || !enabled()) return undefined; return q .from({ inbox: inboxCollection }) .where(({ inbox }) => not(eq(inbox.status, "deleted"))) diff --git a/frontend/src/ts/commandline/commandline-metadata.ts b/frontend/src/ts/commandline/commandline-metadata.ts index 9744c9ee16ab..afb70b6653c2 100644 --- a/frontend/src/ts/commandline/commandline-metadata.ts +++ b/frontend/src/ts/commandline/commandline-metadata.ts @@ -3,11 +3,11 @@ import * as SoundController from "../controllers/sound-controller"; import * as TestLogic from "../test/test-logic"; import { getLanguageDisplayString } from "../utils/strings"; import * as ModesNotice from "../elements/modes-notice"; -import { isAuthenticated } from "../firebase"; + import { areUnsortedArraysEqual } from "../utils/arrays"; import { Config } from "../config/store"; import { get as getTypingSpeedUnit } from "../utils/typing-speed-units"; -import { getActivePage } from "../states/core"; +import { getActivePage, isAuthenticated } from "../states/core"; import { Fonts } from "../constants/fonts"; import { KnownFontName } from "@monkeytype/schemas/fonts"; import * as UI from "../ui"; diff --git a/frontend/src/ts/commandline/lists.ts b/frontend/src/ts/commandline/lists.ts index 7f9917222cb3..4a095f7b4f86 100644 --- a/frontend/src/ts/commandline/lists.ts +++ b/frontend/src/ts/commandline/lists.ts @@ -32,7 +32,8 @@ import * as TestStats from "../test/test-stats"; import { Command, CommandsSubgroup } from "./types"; import { buildCommandForConfigKey } from "./util"; import { CommandlineConfigMetadataObject } from "./commandline-metadata"; -import { isAuthAvailable, isAuthenticated, signOut } from "../firebase"; +import { isAuthAvailable, signOut } from "../firebase"; +import { isAuthenticated } from "../states/core"; import { ConfigKey } from "@monkeytype/schemas/configs"; import { hideFpsCounter, diff --git a/frontend/src/ts/commandline/lists/custom-themes-list.ts b/frontend/src/ts/commandline/lists/custom-themes-list.ts index aacf492df125..f513ba2bb84f 100644 --- a/frontend/src/ts/commandline/lists/custom-themes-list.ts +++ b/frontend/src/ts/commandline/lists/custom-themes-list.ts @@ -1,5 +1,5 @@ import { setConfig } from "../../config/setters"; -import { isAuthenticated } from "../../firebase"; +import { isAuthenticated } from "../../states/core"; import * as DB from "../../db"; import * as ThemeController from "../../controllers/theme-controller"; import { Command, CommandsSubgroup } from "../types"; diff --git a/frontend/src/ts/commandline/lists/navigation.ts b/frontend/src/ts/commandline/lists/navigation.ts index caf68b4cefa4..fc81b9b6ea77 100644 --- a/frontend/src/ts/commandline/lists/navigation.ts +++ b/frontend/src/ts/commandline/lists/navigation.ts @@ -1,5 +1,5 @@ import { navigate } from "../../controllers/route-controller"; -import { isAuthenticated } from "../../firebase"; +import { isAuthenticated } from "../../states/core"; import { toggleFullscreen } from "../../utils/misc"; import { Command } from "../types"; diff --git a/frontend/src/ts/commandline/lists/presets.ts b/frontend/src/ts/commandline/lists/presets.ts index 552440a6fbb2..8720745f0dfe 100644 --- a/frontend/src/ts/commandline/lists/presets.ts +++ b/frontend/src/ts/commandline/lists/presets.ts @@ -3,7 +3,7 @@ import * as ModesNotice from "../../elements/modes-notice"; import * as Settings from "../../pages/settings"; import * as PresetController from "../../controllers/preset-controller"; import * as EditPresetPopup from "../../modals/edit-preset"; -import { isAuthenticated } from "../../firebase"; +import { isAuthenticated } from "../../states/core"; import { Command, CommandsSubgroup } from "../types"; const subgroup: CommandsSubgroup = { diff --git a/frontend/src/ts/commandline/lists/quote-favorites.ts b/frontend/src/ts/commandline/lists/quote-favorites.ts index ecfe6bf8876b..360b96e0d268 100644 --- a/frontend/src/ts/commandline/lists/quote-favorites.ts +++ b/frontend/src/ts/commandline/lists/quote-favorites.ts @@ -4,7 +4,7 @@ import { showErrorNotification, showSuccessNotification, } from "../../states/notifications"; -import { isAuthenticated } from "../../firebase"; +import { isAuthenticated } from "../../states/core"; import { showLoaderBar, hideLoaderBar } from "../../states/loader-bar"; import * as TestWords from "../../test/test-words"; import { Command } from "../types"; diff --git a/frontend/src/ts/commandline/lists/tags.ts b/frontend/src/ts/commandline/lists/tags.ts index 33a18be8abf9..4ea7b7ea1792 100644 --- a/frontend/src/ts/commandline/lists/tags.ts +++ b/frontend/src/ts/commandline/lists/tags.ts @@ -4,7 +4,7 @@ import * as ModesNotice from "../../elements/modes-notice"; import * as TagController from "../../controllers/tag-controller"; import { Config } from "../../config/store"; import * as PaceCaret from "../../test/pace-caret"; -import { isAuthenticated } from "../../firebase"; +import { isAuthenticated } from "../../states/core"; import { Command, CommandsSubgroup } from "../types"; const subgroup: CommandsSubgroup = { diff --git a/frontend/src/ts/components/common/anime/AnimeConditional.tsx b/frontend/src/ts/components/common/anime/AnimeConditional.tsx index f3040115a453..cd14b8950c0d 100644 --- a/frontend/src/ts/components/common/anime/AnimeConditional.tsx +++ b/frontend/src/ts/components/common/anime/AnimeConditional.tsx @@ -15,7 +15,7 @@ import { AnimePresence } from "./AnimePresence"; * @example * ```tsx * } * else={} * exitBeforeEnter diff --git a/frontend/src/ts/components/layout/footer/ThemeIndicator.tsx b/frontend/src/ts/components/layout/footer/ThemeIndicator.tsx index 9b91c232e84b..de67f5b25a83 100644 --- a/frontend/src/ts/components/layout/footer/ThemeIndicator.tsx +++ b/frontend/src/ts/components/layout/footer/ThemeIndicator.tsx @@ -2,9 +2,9 @@ import { JSXElement, Show } from "solid-js"; import { setConfig } from "../../../config/setters"; import { Config } from "../../../config/store"; -import { isAuthenticated } from "../../../firebase"; import { getThemeIndicator, + isAuthenticated, setCommandlineSubgroup, } from "../../../states/core"; import { showModal } from "../../../states/modals"; diff --git a/frontend/src/ts/components/modals/MobileTestConfigModal.tsx b/frontend/src/ts/components/modals/MobileTestConfigModal.tsx index 4b3ab07c5b0e..69719e717f31 100644 --- a/frontend/src/ts/components/modals/MobileTestConfigModal.tsx +++ b/frontend/src/ts/components/modals/MobileTestConfigModal.tsx @@ -9,7 +9,7 @@ import { For, JSXElement, Show } from "solid-js"; import { setConfig, setQuoteLengthAll } from "../../config/setters"; import { getConfig } from "../../config/store"; import { restartTestEvent } from "../../events/test"; -import { isLoggedIn } from "../../states/core"; +import { isAuthenticated } from "../../states/core"; import { showModal } from "../../states/modals"; import { areUnsortedArraysEqual } from "../../utils/arrays"; import { AnimatedModal } from "../common/AnimatedModal"; @@ -186,7 +186,7 @@ export function MobileTestConfigModal(): JSXElement { {(ql) => ( - + void; onToggleFavorite: () => Promise; }): JSXElement { - const loggedOut = (): boolean => !isLoggedIn(); + const loggedOut = (): boolean => !isAuthenticated(); const [isFav, setIsFav] = createSignal( // oxlint-disable-next-line solid/reactivity -- intentionally reading once as initial value !loggedOut() && QuotesController.isQuoteFavorite(props.quote), @@ -459,7 +459,7 @@ export function QuoteSearchModal(): JSXElement {
Quote search
- +
- +