From 197ea8886159913d5a5b0e002e1e92a62c419fa2 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Tue, 10 Sep 2024 10:15:39 +1000 Subject: [PATCH] fix: addressing more PR reviews --- .../conversation/message/message-content/MessageReactBar.tsx | 2 +- ts/components/dialog/blockOrUnblock/BlockOrUnblockDialog.tsx | 1 + ts/node/spell_check.ts | 3 +-- ts/util/i18n/localizedString.ts | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ts/components/conversation/message/message-content/MessageReactBar.tsx b/ts/components/conversation/message/message-content/MessageReactBar.tsx index c5869057e..c02f68475 100644 --- a/ts/components/conversation/message/message-content/MessageReactBar.tsx +++ b/ts/components/conversation/message/message-content/MessageReactBar.tsx @@ -100,7 +100,7 @@ function formatTimeLeft({ timeLeftMs }: { timeLeftMs: number }) { const timeLeftSeconds = Math.floor(timeLeftMs / 1000); if (timeLeftSeconds <= 0) { - return `0s`; + return '0s'; } const [time_large, time_small] = formatAbbreviatedExpireDoubleTimer(timeLeftSeconds); diff --git a/ts/components/dialog/blockOrUnblock/BlockOrUnblockDialog.tsx b/ts/components/dialog/blockOrUnblock/BlockOrUnblockDialog.tsx index 397da24e9..4d5ea7bff 100644 --- a/ts/components/dialog/blockOrUnblock/BlockOrUnblockDialog.tsx +++ b/ts/components/dialog/blockOrUnblock/BlockOrUnblockDialog.tsx @@ -68,6 +68,7 @@ export const BlockOrUnblockDialog = ({ pubkeys, action, onConfirmed }: NonNullab // we never block more than one user from the UI, so this is not very useful, just a type guard for (let index = 0; index < pubkeys.length; index++) { const pubkey = pubkeys[index]; + // TODO: make BlockedNumberController.block take an array and do the change in a single call. // eslint-disable-next-line no-await-in-loop await BlockedNumberController.block(pubkey); } diff --git a/ts/node/spell_check.ts b/ts/node/spell_check.ts index 24287a661..ccd0d9bcf 100644 --- a/ts/node/spell_check.ts +++ b/ts/node/spell_check.ts @@ -7,8 +7,7 @@ export const setup = (browserWindow: BrowserWindow, i18n: SetupI18nReturnType) = // NOTE: we do not rely on the locale parsed by node here because we want // to support a broader list of spell checks than what the app is localised for. // For instance: en_AU is not a supported language on crowdin, but we still want the user to - // - if he has the dictionaries installed for it - be able to spell check "esky", "arvo" or "bogan" - // + // - if they have the dictionary installed for it - we should be able to spell check "esky", "arvo" or "bogan" const userLocale = process.env.LANGUAGE ? process.env.LANGUAGE : osLocaleSync().replace(/_/g, '-'); diff --git a/ts/util/i18n/localizedString.ts b/ts/util/i18n/localizedString.ts index de52e37a5..759ded8fb 100644 --- a/ts/util/i18n/localizedString.ts +++ b/ts/util/i18n/localizedString.ts @@ -93,6 +93,7 @@ function getPluralKey(string: PluralString): R { return match?.[1] as R; } +// TODO This regex is only going to work for the one/other case what about other langs where we can have one/two/other for example const isPluralForm = (localizedString: string): localizedString is PluralString => /{\w+, plural, one \[.+\] other \[.+\]}/g.test(localizedString);