This commit is contained in:
kakkokari-gtyih
2024-06-29 18:14:35 +09:00
parent 1ed6ed6ef0
commit 7ef81ce6d3
5 changed files with 42 additions and 36 deletions

View File

@@ -4,6 +4,7 @@
*/
import { miLocalStorage } from '@/local-storage.js';
import { isEmbedPage } from '@/scripts/embed-page.js';
const address = new URL(document.querySelector<HTMLMetaElement>('meta[property="instance_url"]')?.content || location.href);
const siteName = document.querySelector<HTMLMetaElement>('meta[property="og:site_name"]')?.content;
@@ -21,7 +22,9 @@ export const version = _VERSION_;
export const instanceName = siteName === 'Misskey' || siteName == null ? host : siteName;
export const ui = miLocalStorage.getItem('ui');
export const debug = miLocalStorage.getItem('debug') === 'true';
export const embedPage = location.pathname.startsWith('/embed');
// config.tsでインポートしているファイルと、その内部で使用される関数では使用できない。
// それらでembedPageの判定をしたい場合は関数を直接呼び出すこと
export const embedPage = isEmbedPage();
export function updateLocale(newLocale): void {
locale = newLocale;