Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"concurrently": "8.2.2",
"openapi3-ts": "2.0.2",
"oxlint": "1.57.0",
"oxlint-tsgolint": "0.17.3",
"oxlint-tsgolint": "0.18.1",
"readline-sync": "1.4.10",
"supertest": "7.1.4",
"testcontainers": "11.11.0",
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"magic-string": "0.30.17",
"normalize.css": "8.0.1",
"oxlint": "1.57.0",
"oxlint-tsgolint": "0.17.3",
"oxlint-tsgolint": "0.18.1",
"postcss": "8.5.8",
"sass": "1.70.0",
"solid-devtools": "0.34.5",
Expand Down
25 changes: 14 additions & 11 deletions frontend/src/ts/components/modals/QuoteSearchModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,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 { isAuthenticated } from "../../firebase";
import { isLoggedIn } from "../../states/core";
import { hideLoaderBar, showLoaderBar } from "../../states/loader-bar";
import {
hideModalAndClearChain,
Expand Down Expand Up @@ -100,12 +100,12 @@ function getLengthDesc(quote: Quote): string {
function Item(props: {
quote: Quote;
matchedTerms: string[];
dataBalloonDirection: string;
isRtl: boolean;
onSelect: () => void;
onReport: () => void;
onToggleFavorite: () => Promise<boolean>;
}): JSXElement {
const loggedOut = (): boolean => !isAuthenticated();
const loggedOut = (): boolean => !isLoggedIn();
const [isFav, setIsFav] = createSignal(
// oxlint-disable-next-line solid/reactivity -- intentionally reading once as initial value
!loggedOut() && QuotesController.isQuoteFavorite(props.quote),
Expand Down Expand Up @@ -169,7 +169,7 @@ function Item(props: {
}}
balloon={{
text: "Report quote",
position: props.dataBalloonDirection as "left" | "right",
position: props.isRtl ? "right" : "left",
}}
/>
<Button
Expand All @@ -184,7 +184,7 @@ function Item(props: {
}}
balloon={{
text: "Favorite quote",
position: props.dataBalloonDirection as "left" | "right",
position: props.isRtl ? "right" : "left",
}}
/>
</div>
Expand Down Expand Up @@ -213,7 +213,7 @@ export function QuoteSearchModal(): JSXElement {
quotes: Quote[];
matchedTerms: string[];
}>({ quotes: [], matchedTerms: [] });
const [dataBalloonDirection, setDataBalloonDirection] = createSignal("left");
const [isRtl, setIsRtl] = createSignal(false);
const [favVersion, setFavVersion] = createSignal(0);

const debouncedSearch = debounce(250, (text: string) => {
Expand Down Expand Up @@ -374,7 +374,7 @@ export function QuoteSearchModal(): JSXElement {

const handleAfterShow = async (): Promise<void> => {
const quotesLanguage = await getLanguage(Config.language);
setDataBalloonDirection(quotesLanguage?.rightToLeft ? "right" : "left");
setIsRtl(quotesLanguage?.rightToLeft ?? false);
const { quotes: fetchedQuotes } = await QuotesController.getQuotes(
Config.language,
);
Expand Down Expand Up @@ -455,7 +455,7 @@ export function QuoteSearchModal(): JSXElement {
<div class="flex flex-col justify-between gap-2 sm:flex-row">
<div class="text-2xl text-sub">Quote search</div>
<div class="grid gap-2">
<Show when={isAuthenticated()}>
<Show when={isLoggedIn()}>
<Button
fa={{ icon: "fa-plus" }}
text="Submit a quote"
Expand Down Expand Up @@ -509,7 +509,7 @@ export function QuoteSearchModal(): JSXElement {
}}
/>
</div>
<Show when={isAuthenticated()}>
<Show when={isLoggedIn()}>
<Button
variant="button"
fa={{ icon: "fa-heart", fixedWidth: true }}
Expand All @@ -518,13 +518,16 @@ export function QuoteSearchModal(): JSXElement {
/>
</Show>
</div>
<div class="grid content-baseline gap-2 overflow-y-auto" dir="auto">
<div
class="grid content-baseline gap-2 overflow-y-auto"
dir={isRtl() ? "rtl" : undefined}
>
<For each={pageQuotes()}>
{(quote) => (
<Item
quote={quote}
matchedTerms={searchResults().matchedTerms}
dataBalloonDirection={dataBalloonDirection()}
isRtl={isRtl()}
onSelect={() => applyQuote(quote.id)}
onReport={() => showQuoteReportModal(quote.id)}
// oxlint-disable-next-line solid/reactivity, typescript-eslint/promise-function-async -- fire-and-forget, no reactive tracking needed
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/ts/firebase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ export async function init(callback: ReadyCallback): Promise<void> {

onAuthStateChanged(Auth, async (user) => {
if (!ignoreAuthCallback) {
await callback(true, user);
setUserId(user?.uid ?? null);
await callback(true, user);
}
});
} catch (e) {
Expand Down Expand Up @@ -159,6 +159,7 @@ export async function signInWithPopup(
googleSignUpEvent.dispatch({ signedInUser, isNewUser: true });
} else {
ignoreAuthCallback = false;
setUserId(signedInUser.user.uid);
await readyCallback?.(true, signedInUser.user);
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"only-allow": "1.2.1",
"oxfmt": "0.42.0",
"oxlint": "1.57.0",
"oxlint-tsgolint": "0.17.3",
"oxlint-tsgolint": "0.18.1",
"prettier": "3.7.1",
"turbo": "2.7.5",
"vitest": "4.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@monkeytype/typescript-config": "workspace:*",
"madge": "8.0.0",
"oxlint": "1.57.0",
"oxlint-tsgolint": "0.17.3",
"oxlint-tsgolint": "0.18.1",
"tsup": "8.4.0",
"typescript": "6.0.2",
"vitest": "4.1.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/funbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@monkeytype/typescript-config": "workspace:*",
"madge": "8.0.0",
"oxlint": "1.57.0",
"oxlint-tsgolint": "0.17.3",
"oxlint-tsgolint": "0.18.1",
"tsup": "8.4.0",
"typescript": "6.0.2",
"vitest": "4.1.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/release/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
"devDependencies": {
"nodemon": "3.1.14",
"oxlint": "1.57.0",
"oxlint-tsgolint": "0.17.3"
"oxlint-tsgolint": "0.18.1"
}
}
2 changes: 1 addition & 1 deletion packages/schemas/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@monkeytype/typescript-config": "workspace:*",
"madge": "8.0.0",
"oxlint": "1.57.0",
"oxlint-tsgolint": "0.17.3",
"oxlint-tsgolint": "0.18.1",
"tsup": "8.4.0",
"typescript": "6.0.2",
"vitest": "4.1.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/tsup-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"devDependencies": {
"@monkeytype/typescript-config": "workspace:*",
"oxlint": "1.57.0",
"oxlint-tsgolint": "0.17.3",
"oxlint-tsgolint": "0.18.1",
"typescript": "6.0.2"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@monkeytype/typescript-config": "workspace:*",
"madge": "8.0.0",
"oxlint": "1.57.0",
"oxlint-tsgolint": "0.17.3",
"oxlint-tsgolint": "0.18.1",
"tsup": "8.4.0",
"typescript": "6.0.2",
"vitest": "4.1.0",
Expand Down
Loading
Loading