Skip to content
Snippets Groups Projects
Commit e512f8c5 authored by syuilo's avatar syuilo
Browse files

fix(frontend): 標準テーマと同じIDを使用してインストールできてしまう問題を修正

Fix #12188
parent 183e5cef
No related branches found
No related tags found
No related merge requests found
......@@ -44,6 +44,7 @@
- Fix: 一部の言語でMisskey Webがクラッシュする問題を修正
- Fix: チャンネルの作成・更新時に失敗した場合何も表示されない問題を修正 #11983
- Fix: 個人カードのemojiがバッテリーになっている問題を修正
- Fix: 標準テーマと同じIDを使用してインストールできてしまう問題を修正
### Server
- Enhance: RedisへのTLのキャッシュをオフにできるように
......
......@@ -3,7 +3,7 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { Theme } from '@/scripts/theme.js';
import { Theme, getBuiltinThemes } from '@/scripts/theme.js';
import { miLocalStorage } from '@/local-storage.js';
import { api } from '@/os.js';
import { $i } from '@/account.js';
......@@ -29,6 +29,10 @@ export async function fetchThemes(): Promise<void> {
export async function addTheme(theme: Theme): Promise<void> {
if ($i == null) return;
const builtinThemes = await getBuiltinThemes();
if (builtinThemes.some(t => t.id === theme.id)) {
throw new Error('builtin theme');
}
await fetchThemes();
const themes = getThemes().concat(theme);
await api('i/registry/set', { scope: ['client'], key: 'themes', value: themes });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment