refactor: 收口创作直达恢复判定
This commit is contained in:
@@ -158,7 +158,6 @@ import {
|
||||
} from '../../services/creationEntryConfigService';
|
||||
import {
|
||||
clearCreationUrlState,
|
||||
isCreationRestorePath,
|
||||
readCreationUrlState,
|
||||
writeCreationUrlState,
|
||||
} from '../../services/creationUrlState';
|
||||
@@ -408,9 +407,9 @@ import {
|
||||
buildSquareHoleCreationUrlState,
|
||||
buildVisualNovelCreationUrlState,
|
||||
buildWoodenFishCreationUrlState,
|
||||
hasCreationUrlStateValue,
|
||||
hasPuzzleRuntimeUrlStateValue,
|
||||
normalizeCreationUrlValue,
|
||||
resolveInitialCreationUrlRestoreDecision,
|
||||
} from './platformCreationUrlStateModel';
|
||||
import { resolvePlatformCreationWorkDeleteConfirmationModel } from './platformCreationWorkDeleteFlow';
|
||||
import {
|
||||
@@ -12136,23 +12135,22 @@ export function PlatformEntryFlowShellImpl({
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (handledInitialCreationUrlStateRef.current) {
|
||||
const restoreDecision = resolveInitialCreationUrlRestoreDecision({
|
||||
handled: handledInitialCreationUrlStateRef.current,
|
||||
pathname: window.location.pathname,
|
||||
state: initialCreationUrlState,
|
||||
isLoadingPlatform: platformBootstrap.isLoadingPlatform,
|
||||
canReadProtectedData: platformBootstrap.canReadProtectedData,
|
||||
});
|
||||
|
||||
if (restoreDecision.type === 'skip' || restoreDecision.type === 'wait') {
|
||||
return;
|
||||
}
|
||||
if (!isCreationRestorePath(window.location.pathname)) {
|
||||
|
||||
if (restoreDecision.type === 'mark-handled') {
|
||||
handledInitialCreationUrlStateRef.current = true;
|
||||
return;
|
||||
}
|
||||
if (!hasCreationUrlStateValue(initialCreationUrlState)) {
|
||||
handledInitialCreationUrlStateRef.current = true;
|
||||
return;
|
||||
}
|
||||
if (platformBootstrap.isLoadingPlatform) {
|
||||
return;
|
||||
}
|
||||
if (!platformBootstrap.canReadProtectedData) {
|
||||
return;
|
||||
}
|
||||
|
||||
handledInitialCreationUrlStateRef.current = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user