chore: test deploy snapshot
This commit is contained in:
@@ -1198,7 +1198,11 @@ function buildAbsoluteShareUrl(path?: string | null) {
|
||||
return new URL(normalizedPath, window.location.origin).toString();
|
||||
}
|
||||
|
||||
function createChatShareManifestObjectUrl(pathname: string, title?: string | null) {
|
||||
function createChatShareManifestHref(pathname: string, title?: string | null) {
|
||||
if (isAppleMobileDevice()) {
|
||||
return '/chat-share.webmanifest';
|
||||
}
|
||||
|
||||
const normalizedTitle = title?.trim();
|
||||
return createInstallManifestObjectUrl({
|
||||
startPath: pathname,
|
||||
@@ -3367,7 +3371,7 @@ export function ChatSharePage() {
|
||||
themeColor: resolveSharePlayAppInstallThemeColor(activeInstallAppId),
|
||||
backgroundColor: '#eff5ff',
|
||||
})
|
||||
: createChatShareManifestObjectUrl(sharePathname, snapshot?.conversation.title);
|
||||
: createChatShareManifestHref(sharePathname, snapshot?.conversation.title);
|
||||
const restoreManifest = activeInstallAppEntry
|
||||
? swapInstallDocumentMetadata({
|
||||
manifestHref: manifestObjectUrl,
|
||||
@@ -3378,7 +3382,7 @@ export function ChatSharePage() {
|
||||
|
||||
return () => {
|
||||
restoreManifest();
|
||||
if (manifestObjectUrl) {
|
||||
if (manifestObjectUrl.startsWith('blob:')) {
|
||||
window.URL.revokeObjectURL(manifestObjectUrl);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -154,13 +154,14 @@ export function swapInstallDocumentMetadata(options: SwapInstallDocumentMetadata
|
||||
|
||||
|
||||
type BootstrapInstallMetadataResult = {
|
||||
manifestObjectUrl: string;
|
||||
manifestHref: string;
|
||||
title: string;
|
||||
themeColor: string;
|
||||
} | null;
|
||||
|
||||
type BootstrapInstallMetadataDefinition = {
|
||||
description: string;
|
||||
manifestPath?: string;
|
||||
scope?: string;
|
||||
shortName?: string;
|
||||
themeColor: string;
|
||||
@@ -234,6 +235,7 @@ function resolveBootstrapInstallMetadataDefinition(pathname: string, search: str
|
||||
shortName: '공유채팅',
|
||||
description: '리소스 공유 채팅방을 홈 화면 앱으로 바로 엽니다.',
|
||||
themeColor: '#165dff',
|
||||
manifestPath: '/chat-share.webmanifest',
|
||||
scope: pathname,
|
||||
};
|
||||
}
|
||||
@@ -254,7 +256,7 @@ export function applyBootstrapInstallMetadataForCurrentRoute(): BootstrapInstall
|
||||
}
|
||||
|
||||
return {
|
||||
manifestObjectUrl: createCurrentRouteInstallManifestObjectUrl(metadata),
|
||||
manifestHref: metadata.manifestPath ?? createCurrentRouteInstallManifestObjectUrl(metadata),
|
||||
title: metadata.title,
|
||||
themeColor: metadata.themeColor,
|
||||
};
|
||||
|
||||
@@ -19,9 +19,9 @@ async function bootstrap() {
|
||||
if (typeof window !== 'undefined') {
|
||||
const bootstrapInstallMetadata = applyBootstrapInstallMetadataForCurrentRoute();
|
||||
|
||||
if (bootstrapInstallMetadata?.manifestObjectUrl) {
|
||||
if (bootstrapInstallMetadata?.manifestHref) {
|
||||
restoreBootstrapInstallMetadata = swapInstallDocumentMetadata({
|
||||
manifestHref: bootstrapInstallMetadata.manifestObjectUrl,
|
||||
manifestHref: bootstrapInstallMetadata.manifestHref,
|
||||
title: bootstrapInstallMetadata.title,
|
||||
themeColor: bootstrapInstallMetadata.themeColor,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user