refactor: 收口公开详情点赞意图

This commit is contained in:
2026-06-04 00:27:34 +08:00
parent 8c54d40b9c
commit 872d741fdc
6 changed files with 131 additions and 28 deletions

View File

@@ -532,6 +532,7 @@ import {
resolvePlatformPublicWorkActionMode,
resolvePlatformPublicWorkDetailOpenDecision,
resolvePlatformPublicWorkDetailOpenStrategy,
resolvePlatformPublicWorkLikeIntent,
resolveVisiblePuzzleDetailCoverCount,
} from './platformPublicWorkDetailFlow';
import {
@@ -10778,11 +10779,13 @@ export function PlatformEntryFlowShellImpl({
setIsPublicWorkDetailBusy(true);
setPublicWorkDetailError(null);
if (isBigFishGalleryEntry(entry)) {
void likeBigFishGalleryWork(entry.profileId)
const intent = resolvePlatformPublicWorkLikeIntent(entry);
if (intent.type === 'like-big-fish') {
void likeBigFishGalleryWork(intent.profileId)
.then((response) => {
const updatedWork = response.items.find(
(item) => item.sourceSessionId === entry.profileId,
(item) => item.sourceSessionId === intent.profileId,
);
if (!updatedWork) {
return;
@@ -10817,8 +10820,8 @@ export function PlatformEntryFlowShellImpl({
return;
}
if (isPuzzleGalleryEntry(entry)) {
void likePuzzleGalleryWork(entry.profileId)
if (intent.type === 'like-puzzle') {
void likePuzzleGalleryWork(intent.profileId)
.then((response) => {
const updatedWork = response.item;
setPuzzleGalleryEntries((current) =>
@@ -10851,31 +10854,13 @@ export function PlatformEntryFlowShellImpl({
return;
}
if (isEdutainmentGalleryEntry(entry)) {
setPublicWorkDetailError('宝贝识物点赞将在后续版本开放。');
if (intent.type === 'unsupported') {
setPublicWorkDetailError(intent.errorMessage);
setIsPublicWorkDetailBusy(false);
return;
}
if (isBarkBattleGalleryEntry(entry)) {
setPublicWorkDetailError('汪汪声浪点赞将在后续版本开放。');
setIsPublicWorkDetailBusy(false);
return;
}
if (isSquareHoleGalleryEntry(entry)) {
setPublicWorkDetailError('方洞挑战点赞将在后续版本开放。');
setIsPublicWorkDetailBusy(false);
return;
}
if (isVisualNovelGalleryEntry(entry)) {
setPublicWorkDetailError('视觉小说点赞将在后续版本开放。');
setIsPublicWorkDetailBusy(false);
return;
}
void likeRpgEntryWorldGallery(entry.ownerUserId, entry.profileId)
void likeRpgEntryWorldGallery(intent.ownerUserId, intent.profileId)
.then((updatedEntry) => {
setSelectedDetailEntry((current) =>
current?.profileId === updatedEntry.profileId