mirror of
https://example.com
synced 2024-11-22 10:26:39 +09:00
chore: don't use CDN if useEmojiCdn is disabled
This commit is contained in:
parent
cb9ea0708a
commit
e06a251431
4 changed files with 9 additions and 2 deletions
|
@ -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"
|
||||
|
||||
|
|
|
@ -1008,6 +1008,8 @@ emphasizeFollowed: "フォロワーのアカウントに表示される「フォ
|
|||
iconSet: "アイコンのスタイル"
|
||||
useEmojiCdn: "CDNのTwemojiを利用する"
|
||||
useEmojiCdnDescription: "サーバー上に保存されているTwemojiのアセットの代わりに、JSDelivr CDNから配信されたものを用います。"
|
||||
useCdn: "CDNのアセットを利用する"
|
||||
useCdnDescription: "このFirefishサーバーからではなくJSDelivr CDNからTwiemojiなどのアセットを読み込みます。"
|
||||
|
||||
_sensitiveMediaDetection:
|
||||
description: "機械学習を使って自動でセンシティブなメディアを検出し、モデレーションに役立てられます。サーバーの負荷が少し増えます。"
|
||||
|
|
|
@ -309,9 +309,9 @@
|
|||
}}</span></FormSwitch
|
||||
>
|
||||
<FormSwitch v-model="useEmojiCdn" class="_formBlock"
|
||||
>{{ i18n.ts.useEmojiCdn
|
||||
>{{ i18n.ts.useCdn
|
||||
}}<template #caption>{{
|
||||
i18n.ts.useEmojiCdnDescription
|
||||
i18n.ts.useCdnDescription
|
||||
}}</template></FormSwitch
|
||||
>
|
||||
<FormSwitch
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import Prism from "prismjs";
|
||||
import "prismjs/plugins/autoloader/prism-autoloader.js";
|
||||
import { defaultStore } from "@/store";
|
||||
|
||||
// TODO
|
||||
Prism.plugins.autoloader.languages_path =
|
||||
|
@ -8,6 +9,8 @@ Prism.plugins.autoloader.languages_path =
|
|||
const nonExistingLanguagesCache = new Set<string>();
|
||||
export const loadLanguage = (lang: string) =>
|
||||
new Promise<void>((resolve, reject) => {
|
||||
// for now
|
||||
if (!defaultStore.state.useEmojiCdn) return reject();
|
||||
// cached non-existing language
|
||||
if (nonExistingLanguagesCache.has(lang)) return reject();
|
||||
// load language with autoloader
|
||||
|
|
Loading…
Reference in a new issue