1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-29 16:07:40 +01:00

Merge branch 'dev' into dev

This commit is contained in:
Ashish 2024-01-01 16:08:02 +05:30 committed by GitHub
commit 3b1cb851c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,7 +14,10 @@ export function useRandomTranslation() {
const defaultTitle = t(`${key}.default`) ?? "";
if (!shouldJoke) return defaultTitle;
const keys = t(`${key}.extra`, { returnObjects: true });
const keys = t(`${key}.extra`, {
returnObjects: true,
defaultValue: defaultTitle,
});
if (Array.isArray(keys)) {
if (keys.length === 0) return defaultTitle;
return keys[Math.floor(seed * keys.length)];