同步草稿未读原生角标
平台壳按可见作品架未读完成草稿同步 app.setBadgeCount 新增草稿未读更新计数模型并覆盖多恢复ID去重 更新原生壳方案、HostBridge 协议和共享决策记录
This commit is contained in:
@@ -190,7 +190,10 @@ import {
|
||||
saveBabyObjectMatchDraft,
|
||||
} from '../../services/edutainment-baby-object';
|
||||
import { getExternalGenerationQueueOverview } from '../../services/external-generation';
|
||||
import { showHostLocalNotification } from '../../services/host-bridge/hostBridge';
|
||||
import {
|
||||
setHostAppBadgeCount,
|
||||
showHostLocalNotification,
|
||||
} from '../../services/host-bridge/hostBridge';
|
||||
import {
|
||||
jumpHopClient,
|
||||
type JumpHopGalleryCardResponse,
|
||||
@@ -481,13 +484,13 @@ import {
|
||||
buildPendingBigFishWorks,
|
||||
buildPendingJumpHopWorks,
|
||||
buildPendingMatch3DWorks,
|
||||
buildPendingPuzzleClearWorks,
|
||||
buildPendingPuzzleWorks,
|
||||
buildPendingSquareHoleWorks,
|
||||
buildPendingVisualNovelWorks,
|
||||
buildPendingWoodenFishWorks,
|
||||
collectDraftNoticeKeys,
|
||||
collectVisibleDraftNoticeKeys,
|
||||
countUnreadDraftGenerationUpdates,
|
||||
createPendingDraftShelfState,
|
||||
type DraftGenerationNoticeMap,
|
||||
type DraftGenerationNoticeStatus,
|
||||
@@ -3222,16 +3225,6 @@ export function PlatformEntryFlowShellImpl({
|
||||
],
|
||||
[jumpHopWorks, pendingDraftShelfItems],
|
||||
);
|
||||
const puzzleClearShelfItems = useMemo(
|
||||
() => [
|
||||
...buildPendingPuzzleClearWorks(
|
||||
pendingDraftShelfItems['puzzle-clear'],
|
||||
puzzleClearWorks,
|
||||
),
|
||||
...puzzleClearWorks,
|
||||
],
|
||||
[pendingDraftShelfItems, puzzleClearWorks],
|
||||
);
|
||||
const woodenFishShelfItems = useMemo(
|
||||
() => [
|
||||
...buildPendingWoodenFishWorks(
|
||||
@@ -3298,28 +3291,24 @@ export function PlatformEntryFlowShellImpl({
|
||||
}),
|
||||
[draftGenerationNotices, pendingDraftShelfItems],
|
||||
);
|
||||
const visibleDraftNoticeKeys = useMemo(
|
||||
() =>
|
||||
collectVisibleDraftNoticeKeys({
|
||||
rpgItems: creationHubItems,
|
||||
bigFishItems: bigFishShelfItems,
|
||||
jumpHopItems: jumpHopShelfItems,
|
||||
woodenFishItems: woodenFishShelfItems,
|
||||
match3dItems: match3dShelfItems,
|
||||
squareHoleItems: isSquareHoleCreationVisible
|
||||
? squareHoleShelfItems
|
||||
: [],
|
||||
puzzleItems: puzzleShelfItems,
|
||||
visualNovelItems: visualNovelShelfItems,
|
||||
barkBattleItems: barkBattleShelfItems,
|
||||
babyObjectMatchItems: babyObjectMatchDrafts,
|
||||
}),
|
||||
const visibleDraftNoticeSources = useMemo(
|
||||
() => ({
|
||||
rpgItems: creationHubItems,
|
||||
bigFishItems: bigFishShelfItems,
|
||||
jumpHopItems: jumpHopShelfItems,
|
||||
woodenFishItems: woodenFishShelfItems,
|
||||
match3dItems: match3dShelfItems,
|
||||
squareHoleItems: isSquareHoleCreationVisible ? squareHoleShelfItems : [],
|
||||
puzzleItems: puzzleShelfItems,
|
||||
visualNovelItems: visualNovelShelfItems,
|
||||
barkBattleItems: barkBattleShelfItems,
|
||||
babyObjectMatchItems: babyObjectMatchDrafts,
|
||||
}),
|
||||
[
|
||||
babyObjectMatchDrafts,
|
||||
barkBattleShelfItems,
|
||||
bigFishShelfItems,
|
||||
jumpHopShelfItems,
|
||||
puzzleClearShelfItems,
|
||||
woodenFishShelfItems,
|
||||
creationHubItems,
|
||||
isSquareHoleCreationVisible,
|
||||
@@ -3329,6 +3318,18 @@ export function PlatformEntryFlowShellImpl({
|
||||
visualNovelShelfItems,
|
||||
],
|
||||
);
|
||||
const visibleDraftNoticeKeys = useMemo(
|
||||
() => collectVisibleDraftNoticeKeys(visibleDraftNoticeSources),
|
||||
[visibleDraftNoticeSources],
|
||||
);
|
||||
const unreadDraftGenerationUpdateCount = useMemo(
|
||||
() =>
|
||||
countUnreadDraftGenerationUpdates(
|
||||
draftGenerationNotices,
|
||||
visibleDraftNoticeSources,
|
||||
),
|
||||
[draftGenerationNotices, visibleDraftNoticeSources],
|
||||
);
|
||||
const hasUnreadDraftUpdates = useMemo(
|
||||
() =>
|
||||
hasUnreadDraftGenerationUpdates(
|
||||
@@ -3337,6 +3338,9 @@ export function PlatformEntryFlowShellImpl({
|
||||
),
|
||||
[draftGenerationNotices, visibleDraftNoticeKeys],
|
||||
);
|
||||
useEffect(() => {
|
||||
void setHostAppBadgeCount({ count: unreadDraftGenerationUpdateCount });
|
||||
}, [unreadDraftGenerationUpdateCount]);
|
||||
const resultViewError =
|
||||
autosaveCoordinator.customWorldAutoSaveError ??
|
||||
sessionController.customWorldError;
|
||||
|
||||
Reference in New Issue
Block a user