fix: 收窄创作入口关闭熔断范围
This commit is contained in:
@@ -2150,6 +2150,19 @@ function normalizePlatformErrorMessage(message: string | null | undefined) {
|
||||
return normalized ? normalized : null;
|
||||
}
|
||||
|
||||
/** 首页公开数据降级时,入口关闭错误不弹窗;真实创作动作仍由对应工作台提示。 */
|
||||
function isCreationEntryDisabledErrorMessage(
|
||||
message: string | null | undefined,
|
||||
) {
|
||||
const normalized = normalizePlatformErrorMessage(message);
|
||||
return Boolean(
|
||||
normalized &&
|
||||
(normalized.includes('creation_entry_disabled') ||
|
||||
normalized.includes('该玩法入口暂不可用') ||
|
||||
normalized.includes('创作入口已关闭')),
|
||||
);
|
||||
}
|
||||
|
||||
function formatPlatformErrorSource(label: string, id?: string | null) {
|
||||
const normalizedId = id?.trim();
|
||||
return normalizedId ? `${label} ${normalizedId}` : label;
|
||||
@@ -6747,6 +6760,11 @@ export function PlatformEntryFlowShellImpl({
|
||||
isMiniGameDraftGenerating(
|
||||
activePuzzleBackgroundCompileTask?.generationState ?? null,
|
||||
);
|
||||
const platformBootstrapErrorForDisplay = isCreationEntryDisabledErrorMessage(
|
||||
platformBootstrap.platformError,
|
||||
)
|
||||
? null
|
||||
: platformBootstrap.platformError;
|
||||
const [dismissedPlatformErrorDialogKey, setDismissedPlatformErrorDialogKey] =
|
||||
useState<string | null>(null);
|
||||
const [
|
||||
@@ -6774,7 +6792,7 @@ export function PlatformEntryFlowShellImpl({
|
||||
{
|
||||
key: 'platform-bootstrap',
|
||||
source: '平台首页',
|
||||
message: platformBootstrap.platformError,
|
||||
message: platformBootstrapErrorForDisplay,
|
||||
},
|
||||
{
|
||||
key: 'rpg-creation-type',
|
||||
@@ -6954,7 +6972,7 @@ export function PlatformEntryFlowShellImpl({
|
||||
match3dRun?.runId,
|
||||
match3dSession?.sessionId,
|
||||
pendingPlatformTaskFailureDialog,
|
||||
platformBootstrap.platformError,
|
||||
platformBootstrapErrorForDisplay,
|
||||
publicWorkDetailError,
|
||||
puzzleCreationError,
|
||||
puzzleError,
|
||||
@@ -16352,7 +16370,7 @@ export function PlatformEntryFlowShellImpl({
|
||||
platformError={
|
||||
platformBootstrap.isLoadingPlatform
|
||||
? null
|
||||
: (platformBootstrap.platformError ??
|
||||
: (platformBootstrapErrorForDisplay ??
|
||||
sessionController.agentWorkspaceRestoreError)
|
||||
}
|
||||
dashboardError={
|
||||
|
||||
Reference in New Issue
Block a user