埋め込みページかどうかの判定は最初の一回だけに

This commit is contained in:
kakkokari-gtyih 2024-07-06 19:37:58 +09:00
parent 849973ece6
commit e9ef8fc75a
1 changed files with 6 additions and 1 deletions

View File

@ -5,9 +5,14 @@
//#region Embed関連の定義 //#region Embed関連の定義
let _isEmbedPage: boolean | null = null;
/** 埋め込みページかどうか */ /** 埋め込みページかどうか */
export function isEmbedPage() { export function isEmbedPage() {
return location.pathname.startsWith('/embed'); if (_isEmbedPage === null) {
_isEmbedPage = location.pathname.startsWith('/embed/');
}
return _isEmbedPage;
} }
/** 埋め込みの対象となるエンティティ(/embed/xxx の xxx の部分と対応させる) */ /** 埋め込みの対象となるエンティティ(/embed/xxx の xxx の部分と対応させる) */