fix: keep luker host profile before chat selection

This commit is contained in:
Youzini-afk
2026-04-15 22:04:54 +08:00
parent 678e5e51b2
commit c764a000c0
2 changed files with 21 additions and 6 deletions

View File

@@ -182,17 +182,12 @@ function isAndroidWebViewLike() {
export function isLukerHostContext(context = getHostRuntimeContext()) {
const activeContext =
context && typeof context === "object" ? context : getHostRuntimeContext();
const hasImplicitCurrentChat =
Boolean(resolveChatFileName(activeContext)) ||
normalizeString(activeContext.groupId) !== "" ||
normalizeString(activeContext.characterId) !== "";
return (
!!globalThis.Luker &&
typeof globalThis.Luker?.getContext === "function" &&
typeof activeContext.getChatState === "function" &&
typeof activeContext.updateChatState === "function" &&
typeof activeContext.getChatStateBatch === "function" &&
hasImplicitCurrentChat
typeof activeContext.getChatStateBatch === "function"
);
}