diff --git a/package-lock.json b/package-lock.json index d1fe49ea..179a8202 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1624,9 +1624,9 @@ "license": "MIT" }, "node_modules/@formatjs/icu-messageformat-parser": { - "version": "3.5.14", - "resolved": "https://registry.npmjs.org/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-3.5.14.tgz", - "integrity": "sha512-jDvgtoLqe3U6yzoBlToMTkWBe38qSi7LN7kFlnXzd5ig8nn+4tSlED0xtEtdYakZVZGJJY2rW1D5xS3BFZh6kA==", + "version": "3.5.15", + "resolved": "https://registry.npmjs.org/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-3.5.15.tgz", + "integrity": "sha512-5o4grXKotAB3JqQuisLApHG43g17N+paoRTa92Jiz35Zvfemq0cVf4EDvuxyHAzmsJji7igaEowicLO/VmfJ8Q==", "license": "MIT", "dependencies": { "@formatjs/icu-skeleton-parser": "2.1.11" @@ -1639,14 +1639,14 @@ "license": "MIT" }, "node_modules/@formatjs/intl": { - "version": "4.1.16", - "resolved": "https://registry.npmjs.org/@formatjs/intl/-/intl-4.1.16.tgz", - "integrity": "sha512-EJe0wdORNZyzzqOmZs+sqFTL27iTcgNR6aiNT5+OscakcKvA673MyJ4SO9p5L+RQpPDw3v+jWidpo/Jaz14khg==", + "version": "4.1.17", + "resolved": "https://registry.npmjs.org/@formatjs/intl/-/intl-4.1.17.tgz", + "integrity": "sha512-IxluRkzOZH8ahaDip5g8YH9kJi1munUZi9i1BJs1wVFQIY2pROoCSiOlybZegyiPsZlMaYfADkD99zP2xmBfjQ==", "license": "MIT", "dependencies": { "@formatjs/fast-memoize": "3.1.7", - "@formatjs/icu-messageformat-parser": "3.5.14", - "intl-messageformat": "11.2.11" + "@formatjs/icu-messageformat-parser": "3.5.15", + "intl-messageformat": "11.2.12" } }, "node_modules/@google-cloud/cloud-sql-connector": { @@ -4018,9 +4018,9 @@ } }, "node_modules/@next/env": { - "version": "16.2.10", - "resolved": "https://registry.npmjs.org/@next/env/-/env-16.2.10.tgz", - "integrity": "sha512-zLPxg9M0MEHmygpj5OuxjQ+vHMiy/K7cSp74G8ecYolmgUWw0RwN02tF56npup/+qaI8JB97hQgS/r2Hb6QwVA==", + "version": "16.2.11", + "resolved": "https://registry.npmjs.org/@next/env/-/env-16.2.11.tgz", + "integrity": "sha512-0do5A3BJ2gxWr0ZCMcD6BhW+e595jyxdTl3rXTS6lOtD8ektMiW6CO+EPwt1Eca1DBnm90r/7GdiKWBKxH++DA==", "license": "MIT" }, "node_modules/@next/eslint-plugin-next": { @@ -4034,9 +4034,9 @@ } }, "node_modules/@next/swc-darwin-arm64": { - "version": "16.2.10", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-16.2.10.tgz", - "integrity": "sha512-v9IdJCa0H0mbo+8z5zwUpOk1Vj7RjkcI5uNYf5Ws1y6szf/p3Mzl9hLaST8SCt6L9h8NGnruZcd2+o0NTNwDhA==", + "version": "16.2.11", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-16.2.11.tgz", + "integrity": "sha512-wryL4pjKmDwGv2ox6+GZDFxvmtSRLqApBR8kL1j4+vhB7Z5vJC/zAnXpiR9Xkfzl0AS8WLMnsuGV/UKI67/rrw==", "cpu": [ "arm64" ], @@ -4050,9 +4050,9 @@ } }, "node_modules/@next/swc-darwin-x64": { - "version": "16.2.10", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-16.2.10.tgz", - "integrity": "sha512-17IS0jJRViROGmA9uGdNR8VPJpfbnaVG7E9qhso5jDLkmyd0lSDORWxbcKINzcFqzZqGwGtMSnrFRxBpuUYjLQ==", + "version": "16.2.11", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-16.2.11.tgz", + "integrity": "sha512-aZl2j4f/fLyjQvOhv0Oe9UaMAQHolYpKhctsoYzplSumKJKPUmgjcf6545aBtysLTcu994TREd0+pSgNE4ohmg==", "cpu": [ "x64" ], @@ -4066,9 +4066,9 @@ } }, "node_modules/@next/swc-linux-arm64-gnu": { - "version": "16.2.10", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-16.2.10.tgz", - "integrity": "sha512-GRQRsRtuciNJvB54AvvuQTiq0oZtFwa1owQqtZD8wwnGpM2L39MV22kpI72YSXLKIyY40LC66EiLFv4PiicXxg==", + "version": "16.2.11", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-16.2.11.tgz", + "integrity": "sha512-5jEriyEnH/LWFy27L2ZG0XaLlyEJIjhsImEsiS9P563PKEVp2BVups/xfOucIrsvVntp11oNcZwjHvaDPYVB5g==", "cpu": [ "arm64" ], @@ -4085,9 +4085,9 @@ } }, "node_modules/@next/swc-linux-arm64-musl": { - "version": "16.2.10", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-16.2.10.tgz", - "integrity": "sha512-zkN9MQYS7UQBro+FnISUq1itaQjXI9xqISzuQ+2bc921NcJ1x4yPCqrn77tVN6/dOOXaaWVX3k6/bR07pPwK+A==", + "version": "16.2.11", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-16.2.11.tgz", + "integrity": "sha512-eIjcpx2fnnFSSkZDbTxy74KnokUXDjfoLClpWelfgHLf621aTqswhwXQ7GkD5K5rplrS6LZ/Bj+mVuvzluBOEg==", "cpu": [ "arm64" ], @@ -4104,9 +4104,9 @@ } }, "node_modules/@next/swc-linux-x64-gnu": { - "version": "16.2.10", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-16.2.10.tgz", - "integrity": "sha512-iCVJnwvrPYECvA6WM/7+oo+OiTvedIKLxtCLAZP4xZR3nXa1zmzZyLPbYCmWvpd4CvMYF1EMTafd0ii3DygLvA==", + "version": "16.2.11", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-16.2.11.tgz", + "integrity": "sha512-8WgzpaWMs46qJT9kiV47cje86L0x/Mu9t8/Gwj+pnbgW3rETVfCnaScPjlYUwNScpOozdcIMHWmAvuZJUonR2w==", "cpu": [ "x64" ], @@ -4123,9 +4123,9 @@ } }, "node_modules/@next/swc-linux-x64-musl": { - "version": "16.2.10", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-16.2.10.tgz", - "integrity": "sha512-ov2g4H0dHY9bPoOU83m91hWT7Iq5qy13bUnyyshLU3HGR1Ownn0X9QpmDPc5iIUaahTp7f7LeGAhV4DSFtackw==", + "version": "16.2.11", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-16.2.11.tgz", + "integrity": "sha512-I3UgPds7G4ZYnTb/H+5GBGuUT2DhAk6j0mL6A4s63RjFs74wB2hOWP0vaxsK+3NJraExt3eYEPQ/UtT0x/64Nw==", "cpu": [ "x64" ], @@ -4142,9 +4142,9 @@ } }, "node_modules/@next/swc-win32-arm64-msvc": { - "version": "16.2.10", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-16.2.10.tgz", - "integrity": "sha512-DwAnhLX76HQiFFQNgWlcK+JzlnD1rZ+UK/WY0ZMI/deXpvgnesjNYrqcfo1JzBuz4Kf7o3brIBL0glI1junatA==", + "version": "16.2.11", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-16.2.11.tgz", + "integrity": "sha512-n89CjtcThnjrwgJMAiI5xbqwLY51zvwC9tSlArmVndAJLYVl9T9UAdlkXTmZvE++idoXe8KdglQlhNRdUp1c6g==", "cpu": [ "arm64" ], @@ -4158,9 +4158,9 @@ } }, "node_modules/@next/swc-win32-x64-msvc": { - "version": "16.2.10", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-16.2.10.tgz", - "integrity": "sha512-0JXq3b85Jk9Jg4ntLUbXSPvoDw3gpZou7twuKdoFG2jOw635v7+IiXfTaa0TxVMyx78pUjnrVYwLgjKfX4e6/A==", + "version": "16.2.11", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-16.2.11.tgz", + "integrity": "sha512-md8CLNggS1Dx9pUgApzps5uAf+N8GN9xywzmNx9vHAWo94HtBwCCqkSnhIrdfQe83Dhz8Lfo/20Nb1Zxal092w==", "cpu": [ "x64" ], @@ -9887,9 +9887,9 @@ } }, "node_modules/firebase-tools": { - "version": "15.23.0", - "resolved": "https://registry.npmjs.org/firebase-tools/-/firebase-tools-15.23.0.tgz", - "integrity": "sha512-YIu1w84GiJAoQfCDBvrK77Qnu19sh00YufGvrWLc9kus9p8j5NkFOGfSpIAiEHu5VliTZUqBhqDwA/i7fuN0GQ==", + "version": "15.24.0", + "resolved": "https://registry.npmjs.org/firebase-tools/-/firebase-tools-15.24.0.tgz", + "integrity": "sha512-2P5qd3O3YD7a7AaA89lt/zgRIgR7FGS0Ye7fW9z/sNt9/b6cbmI1TtQtYDlmJDUOh9nMk+72ll/gu4MlN/qY7Q==", "dev": true, "license": "MIT", "dependencies": { @@ -11430,13 +11430,13 @@ } }, "node_modules/intl-messageformat": { - "version": "11.2.11", - "resolved": "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-11.2.11.tgz", - "integrity": "sha512-aDG5bvFRbQvRoT2Bh9FV6yV8t7o0MjEGknZ6pnin5Wt52PJwaBOHDfvz+oPEe78Pl3InQYKugBgCdXijLj6viQ==", + "version": "11.2.12", + "resolved": "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-11.2.12.tgz", + "integrity": "sha512-KW70Xxfcvy7vV3qODfvShWkFDPMqKDAa4N+hSyVBWGNtVhTUFYaqlD/l88DaYPKiVcPP4rPQ3qnH7i5K82Mg7g==", "license": "BSD-3-Clause", "dependencies": { "@formatjs/fast-memoize": "3.1.7", - "@formatjs/icu-messageformat-parser": "3.5.14" + "@formatjs/icu-messageformat-parser": "3.5.15" } }, "node_modules/ip-address": { @@ -13152,12 +13152,12 @@ } }, "node_modules/next": { - "version": "16.2.10", - "resolved": "https://registry.npmjs.org/next/-/next-16.2.10.tgz", - "integrity": "sha512-2som5AVXb3kE6Yjine3/mNbBayYF58eguBWIVVUdr1y/L426xyVEgYxgBG+1QC34P2x5E+tcDup6XkuOAX3dCA==", + "version": "16.2.11", + "resolved": "https://registry.npmjs.org/next/-/next-16.2.11.tgz", + "integrity": "sha512-B339zaqbyK8cmxhoAvLrcwoabwCP1wz21zSzfqxqXAemTu2BXnH7tQnfcglKv1vnMUIDBc+Hth7XODQriTZiRQ==", "license": "MIT", "dependencies": { - "@next/env": "16.2.10", + "@next/env": "16.2.11", "@swc/helpers": "0.5.15", "baseline-browser-mapping": "^2.9.19", "caniuse-lite": "^1.0.30001579", @@ -13171,14 +13171,14 @@ "node": ">=20.9.0" }, "optionalDependencies": { - "@next/swc-darwin-arm64": "16.2.10", - "@next/swc-darwin-x64": "16.2.10", - "@next/swc-linux-arm64-gnu": "16.2.10", - "@next/swc-linux-arm64-musl": "16.2.10", - "@next/swc-linux-x64-gnu": "16.2.10", - "@next/swc-linux-x64-musl": "16.2.10", - "@next/swc-win32-arm64-msvc": "16.2.10", - "@next/swc-win32-x64-msvc": "16.2.10", + "@next/swc-darwin-arm64": "16.2.11", + "@next/swc-darwin-x64": "16.2.11", + "@next/swc-linux-arm64-gnu": "16.2.11", + "@next/swc-linux-arm64-musl": "16.2.11", + "@next/swc-linux-x64-gnu": "16.2.11", + "@next/swc-linux-x64-musl": "16.2.11", + "@next/swc-win32-arm64-msvc": "16.2.11", + "@next/swc-win32-x64-msvc": "16.2.11", "sharp": "^0.34.5" }, "peerDependencies": { @@ -13205,9 +13205,9 @@ } }, "node_modules/next-auth": { - "version": "4.24.14", - "resolved": "https://registry.npmjs.org/next-auth/-/next-auth-4.24.14.tgz", - "integrity": "sha512-YRz6xFDXKUwiXSMMChbrBEWyFktZ1qZXEgeSHQQ3nsy08B4c/xLk6REeutRsIFwkjY/1+ShHnu07DN3JeJguig==", + "version": "4.24.15", + "resolved": "https://registry.npmjs.org/next-auth/-/next-auth-4.24.15.tgz", + "integrity": "sha512-NnjYtjrSOAx/TIVFGTX4IfI/9yHnNpi4B7FuLUwuV20v2Zxgr2OGP/YN0ynJuI7y8QOnTBPitfOdEXZrVvhIuA==", "license": "ISC", "dependencies": { "@babel/runtime": "^7.20.13", @@ -13218,7 +13218,7 @@ "openid-client": "^5.4.0", "preact": "^10.6.3", "preact-render-to-string": "^5.1.19", - "uuid": "^8.3.2" + "uuid": "^11.1.1" }, "peerDependencies": { "@auth/core": "0.34.3", @@ -13245,6 +13245,19 @@ "url": "https://github.com/sponsors/panva" } }, + "node_modules/next-auth/node_modules/uuid": { + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.1.tgz", + "integrity": "sha512-vIYxrBCC/N/K+Js3qSN88go7kIfNPssr/hHCesKCQNAjmgvYS2oqr69kIufEG+O4+PfezOH4EbIeHCfFov8ZgQ==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist/esm/bin/uuid" + } + }, "node_modules/next/node_modules/postcss": { "version": "8.4.31", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", @@ -14976,14 +14989,14 @@ } }, "node_modules/react-intl": { - "version": "10.1.16", - "resolved": "https://registry.npmjs.org/react-intl/-/react-intl-10.1.16.tgz", - "integrity": "sha512-wt9lV390x/Fbqx9A1X4F+daxOzBb2LRybc2vNVS6FpI81TnV/LBlN29W3BBeh2b8cP3aWrofyrAhdViE1AD5pQ==", + "version": "10.1.18", + "resolved": "https://registry.npmjs.org/react-intl/-/react-intl-10.1.18.tgz", + "integrity": "sha512-4JMOYakqVn/IajJt8Ad341Iwd6RDtiP1WQZiHRcFpHDBhVW4E9T0vkypSOk69Adg3dEbIYOE4HKTehH/1sSwnw==", "license": "BSD-3-Clause", "dependencies": { - "@formatjs/icu-messageformat-parser": "3.5.14", - "@formatjs/intl": "4.1.16", - "intl-messageformat": "11.2.11" + "@formatjs/icu-messageformat-parser": "3.5.15", + "@formatjs/intl": "4.1.17", + "intl-messageformat": "11.2.12" }, "peerDependencies": { "@types/react": ">=18.0.0", @@ -17544,6 +17557,7 @@ "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", "deprecated": "uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028).", "license": "MIT", + "optional": true, "bin": { "uuid": "dist/bin/uuid" } diff --git a/src/backend/services/edit-game/actions.ts b/src/backend/services/edit-game/actions.ts index bc4dd9eb..f62e726a 100644 --- a/src/backend/services/edit-game/actions.ts +++ b/src/backend/services/edit-game/actions.ts @@ -2,6 +2,7 @@ import EditGameService from '@/backend/services/edit-game/EditGameService'; import { QuestionType } from '@/models/questions/question-type'; +import { RoundData } from '@/models/rounds/round'; import { RoundType } from '@/models/rounds/round-type'; export const addRoundToGame = async (gameId: string, roundTitle: string, roundType: RoundType) => { @@ -29,7 +30,7 @@ export const removeQuestionFromRound = async ( return service.removeQuestionFromRound(questionType, roundId, questionId); }; -export const updateRound = async (gameId: string, roundId: string, roundData: any) => { +export const updateRound = async (gameId: string, roundId: string, roundData: RoundData) => { const service = new EditGameService(gameId); return service.updateRound(roundId, roundData); }; diff --git a/src/backend/services/question/GameBuzzerQuestionService.ts b/src/backend/services/question/GameBuzzerQuestionService.ts index df0b67d4..9de2681e 100644 --- a/src/backend/services/question/GameBuzzerQuestionService.ts +++ b/src/backend/services/question/GameBuzzerQuestionService.ts @@ -271,11 +271,7 @@ export default class GameBuzzerQuestionService extends GameQuestionService { const points = (round as BuzzerRound).rewardsPerQuestion; await this.roundScoreRepo.increaseTeamScoreTransaction(transaction, questionId, teamId, points); - - // Update the winner player status await this.playerRepo.updatePlayerStatusTransaction(transaction, playerId, PlayerStatus.CORRECT); - - // Update the question winner team await (this.gameQuestionRepo as GameBuzzerQuestionRepository).updateQuestionWinnerTransaction( transaction, questionId, @@ -283,7 +279,6 @@ export default class GameBuzzerQuestionService extends GameQuestionService { teamId ); await this.soundRepo.addSoundTransaction(transaction, 'anime_wow'); - await this.endQuestionTransaction(transaction, questionId); this.log.info({ question: questionId, type: this.questionType, player: playerId }, 'Answer validated'); diff --git a/src/backend/services/question/quote/GameQuoteQuestionService.ts b/src/backend/services/question/quote/GameQuoteQuestionService.ts index ff363956..f6a7f64e 100644 --- a/src/backend/services/question/quote/GameQuoteQuestionService.ts +++ b/src/backend/services/question/quote/GameQuoteQuestionService.ts @@ -7,7 +7,7 @@ import GameBuzzerQuestionService from '@/backend/services/question/GameBuzzerQue import { isObjectEmpty } from '@/backend/utils/objects'; import { BuzzerQuestionPlayers } from '@/models/questions/buzzer'; import { QuestionType } from '@/models/questions/question-type'; -import { GameQuoteQuestion, QuoteQuestion } from '@/models/questions/quote'; +import { GameQuoteQuestion, QuotePart, QuoteQuestion } from '@/models/questions/quote'; import { QuoteRound } from '@/models/rounds/quote'; import { PlayerStatus } from '@/models/users/player'; @@ -44,8 +44,8 @@ export default class GameQuoteQuestionService extends GameBuzzerQuestionService {} ); if ((toGuess as string[]).includes('quote')) { - initialRevealed['quote'] = (baseQuestion.quoteParts as unknown[]).reduce( - (acc: Record>, _: unknown, idx: number) => { + initialRevealed['quote'] = (baseQuestion.quoteParts as QuotePart[]).reduce( + (acc: Record>, _: QuotePart, idx: number) => { acc[idx] = {}; return acc; }, @@ -264,14 +264,14 @@ export default class GameQuoteQuestionService extends GameBuzzerQuestionService } const toGuess = baseQuestion.toGuess; - const quoteParts = baseQuestion.quoteParts; + const quoteParts = baseQuestion.quoteParts as QuotePart[]; const temp1 = (toGuess as string[]).every( (elem: string) => newRevealed[elem] && !isObjectEmpty(newRevealed[elem]) ); const newRevealedQuote = newRevealed['quote']; - const temp2 = (quoteParts as unknown[]).every( - (_: unknown, idx: number) => + const temp2 = quoteParts.every( + (_: QuotePart, idx: number) => newRevealedQuote[idx] && !isObjectEmpty(newRevealedQuote[idx] as Record) ); const allRevealed = temp1 && temp2; diff --git a/src/frontend/components/game-editor/EditRoundInGame.tsx b/src/frontend/components/game-editor/EditRoundInGame.tsx index c69f2e50..657abb5e 100644 --- a/src/frontend/components/game-editor/EditRoundInGame.tsx +++ b/src/frontend/components/game-editor/EditRoundInGame.tsx @@ -67,7 +67,7 @@ import defineMessages from '@/frontend/i18n/defineMessages'; import globalMessages from '@/frontend/i18n/globalMessages'; import { GameStatus } from '@/models/games/game-status'; import { QuestionType } from '@/models/questions/question-type'; -import { Round } from '@/models/rounds/round'; +import { Round, RoundData } from '@/models/rounds/round'; import { RoundType, roundTypeToEmoji, roundTypeToTitle } from '@/models/rounds/round-type'; import { AnyRound } from '@/models/rounds/RoundFactory'; import { Timer } from '@/models/timer'; @@ -180,7 +180,7 @@ export const EditGameRoundCard = memo(function EditGameRoundCard({ const v = val as { toDate?: () => Date } | null | undefined; return v?.toDate?.() ? v.toDate().toISOString() : val; }; - const updatedRoundData = { + const updatedRoundData: RoundData = { ...roundObj, questions: reorderedQuestions, createdAt: toDateSafe(roundObj.createdAt), diff --git a/src/frontend/components/home/EndedGames.tsx b/src/frontend/components/home/EndedGames.tsx index 7d3d48e1..a0799f9d 100644 --- a/src/frontend/components/home/EndedGames.tsx +++ b/src/frontend/components/home/EndedGames.tsx @@ -14,7 +14,7 @@ import PlayerRepository from '@/backend/repositories/user/PlayerRepository'; import { Card, CardContent, CardHeader, CardTitle } from '@/frontend/components/card'; import { GameOrganizersAvatarGroup, GamePlayersAvatarGroup } from '@/frontend/components/home/GameAvatars'; import LoadingScreen from '@/frontend/components/LoadingScreen'; -import { Locale, localeToEmoji } from '@/frontend/helpers/locales'; +import { localeToEmoji } from '@/frontend/helpers/locales'; import { timestampToDate, type FirestoreTimestamp } from '@/frontend/helpers/time'; import defineMessages from '@/frontend/i18n/defineMessages'; import globalMessages from '@/frontend/i18n/globalMessages'; @@ -108,9 +108,7 @@ export function EndedGameCard({ game }: EndedGameCardProps) { {game.title} - - {localeToEmoji((game as unknown as { lang: Locale }).lang)} - + {localeToEmoji(game.lang!)} diff --git a/src/frontend/components/question-forms/SubmitQuoteQuestionForm.tsx b/src/frontend/components/question-forms/SubmitQuoteQuestionForm.tsx index 5c5f7c2a..28928a91 100644 --- a/src/frontend/components/question-forms/SubmitQuoteQuestionForm.tsx +++ b/src/frontend/components/question-forms/SubmitQuoteQuestionForm.tsx @@ -25,7 +25,13 @@ import useAsyncAction from '@/frontend/hooks/useAsyncAction'; import defineMessages from '@/frontend/i18n/defineMessages'; import globalMessages from '@/frontend/i18n/globalMessages'; import { QuestionType } from '@/models/questions/question-type'; -import { QuoteAuthorElement, QuotePartElement, QuoteQuestion, QuoteSourceElement } from '@/models/questions/quote'; +import { + QuoteAuthorElement, + QuotePart, + QuotePartElement, + QuoteQuestion, + QuoteSourceElement, +} from '@/models/questions/quote'; import { Topic } from '@/models/topic'; const messages = defineMessages('frontend.forms.submitQuestion.quote', { @@ -55,11 +61,6 @@ const QUOTE_AUTHOR_EXAMPLE: Record = { fr: 'Commandant Shepard', }; -interface QuotePart { - startIdx: number; - endIdx: number; -} - interface QuoteFormValues { lang: string; topic: string;