From b0875f76499e993a5162e1232aa17ef4b22479fa Mon Sep 17 00:00:00 2001 From: naskya Date: Thu, 25 Jan 2024 04:31:11 +0900 Subject: [PATCH] chore: don't use CDN if useEmojiCdn is disabled --- locales/en-US.yml | 2 ++ locales/ja-JP.yml | 2 ++ packages/client/src/pages/settings/general.vue | 4 ++-- packages/client/src/scripts/prism.ts | 3 +++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/locales/en-US.yml b/locales/en-US.yml index d966a4df..330baec9 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -1174,6 +1174,8 @@ pullDownToReload: "Pull down to reload" enableTimelineStreaming: "Update timelines automatically" useEmojiCdn: "Get Twemoji from CDN" useEmojiCdnDescription: "Use Twemoji from the JSDelivr CDN instead of the server's assets." +useCdn: "Get assets from CDN" +useCdnDescription: "Load some static assets like Twemoji from the JSDelivr CDN instead of this Firefish server." suggested: "Suggested" noLanguage: "No language" diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 51d1c689..64fe2b97 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1008,6 +1008,8 @@ emphasizeFollowed: "フォロワーのアカウントに表示される「フォ iconSet: "アイコンのスタイル" useEmojiCdn: "CDNのTwemojiを利用する" useEmojiCdnDescription: "サーバー上に保存されているTwemojiのアセットの代わりに、JSDelivr CDNから配信されたものを用います。" +useCdn: "CDNのアセットを利用する" +useCdnDescription: "このFirefishサーバーからではなくJSDelivr CDNからTwiemojiなどのアセットを読み込みます。" _sensitiveMediaDetection: description: "機械学習を使って自動でセンシティブなメディアを検出し、モデレーションに役立てられます。サーバーの負荷が少し増えます。" diff --git a/packages/client/src/pages/settings/general.vue b/packages/client/src/pages/settings/general.vue index 5685bfa5..95ad5b83 100644 --- a/packages/client/src/pages/settings/general.vue +++ b/packages/client/src/pages/settings/general.vue @@ -309,9 +309,9 @@ }} {{ i18n.ts.useEmojiCdn + >{{ i18n.ts.useCdn }} (); export const loadLanguage = (lang: string) => new Promise((resolve, reject) => { + // for now + if (!defaultStore.state.useEmojiCdn) return resolve(); // cached non-existing language if (nonExistingLanguagesCache.has(lang)) return reject(); // load language with autoloader