fix: preserve iframe plugin chat mode

This commit is contained in:
Rocky Kwok committed 2026-07-28 11:03:28 +08:00
1 parent bd8ec41914
commit 008c9ede6e
3 files changed
+50 -20

No files matched your search

+3 -6
View File
@@ -76,7 +76,6 @@ function summarizeStoredUserInfo(): Record<string, unknown> | null {
}
const DEFAULT_USERNAME = 'guest';
const IFRAME_LOGIN_SOURCE = 'iframe';
const IFRAME_CHAT_MODE = 'iframe';
const DEFAULT_REDIRECT_PATH = '/page/workspace/chats/new';
const FULL_CHAT_MODE = 'full';
@@ -104,15 +103,13 @@ export default function LoginPage() {
searchParams.get('chatMode')?.trim().toLowerCase() ?? '';
const brainyIframeRequested = requestedChatMode === IFRAME_CHAT_MODE;
// Wujie is an application container, not the Brainy iframe protocol. It
// must therefore land on the regular full ChatPage. Legacy `from=iframe`
// links now do the same; only the explicit `chatMode=iframe` protocol opt-in
// is allowed to open IframeChatPage.
// must therefore land on the regular full ChatPage. Plugin links with
// `from=iframe` are normalized into the explicit iframe protocol mode.
const fullChatRequested = useMemo(
() =>
!brainyIframeRequested &&
(isWujieEnv() ||
requestedChatMode === FULL_CHAT_MODE ||
searchParams.get('from') === IFRAME_LOGIN_SOURCE),
requestedChatMode === FULL_CHAT_MODE),
[brainyIframeRequested, requestedChatMode, searchParams],
);
const isIframeLogin = useMemo(