修复小程序推荐页系统分享直达作品
同步推荐页当前作品到小程序原生分享目标 保留小程序系统分享路径中的公开作品参数 补充小程序分享目标解析与前端消息发送测试
This commit is contained in:
@@ -365,6 +365,7 @@ import {
|
||||
updateVisualNovelWork,
|
||||
} from '../../services/visual-novel-works';
|
||||
import { requestGenerationResultSubscribePermission } from '../../services/wechatMiniProgramSubscribe';
|
||||
import { postWechatMiniProgramShareTarget } from '../../services/wechatMiniProgramShareTarget';
|
||||
import {
|
||||
woodenFishClient,
|
||||
type WoodenFishGalleryCardResponse,
|
||||
@@ -741,6 +742,25 @@ function resolveRecommendEntryShareStage(
|
||||
return 'work-detail';
|
||||
}
|
||||
|
||||
function postRecommendEntryMiniProgramShareTarget(
|
||||
entry: PlatformPublicGalleryCard | null | undefined,
|
||||
) {
|
||||
if (!entry) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const publicWorkCode = resolvePlatformPublicWorkCode(entry)?.trim();
|
||||
if (!publicWorkCode) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return postWechatMiniProgramShareTarget({
|
||||
targetPath: '/works/detail',
|
||||
work: publicWorkCode,
|
||||
title: entry.worldName,
|
||||
});
|
||||
}
|
||||
|
||||
function resolveUnsupportedPublicWorkActionMessage(
|
||||
entry: PlatformPublicGalleryCard,
|
||||
actionLabel: string,
|
||||
@@ -5250,6 +5270,7 @@ export function PlatformEntryFlowShellImpl({
|
||||
return;
|
||||
}
|
||||
|
||||
postRecommendEntryMiniProgramShareTarget(entry);
|
||||
openPublishShareModal({
|
||||
title: entry.worldName,
|
||||
publicWorkCode,
|
||||
@@ -16473,6 +16494,22 @@ export function PlatformEntryFlowShellImpl({
|
||||
woodenFishRun,
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (
|
||||
selectionStage !== 'platform' ||
|
||||
platformBootstrap.platformTab !== 'home' ||
|
||||
!activeRecommendEntry
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
postRecommendEntryMiniProgramShareTarget(activeRecommendEntry);
|
||||
}, [
|
||||
activeRecommendEntry,
|
||||
platformBootstrap.platformTab,
|
||||
selectionStage,
|
||||
]);
|
||||
|
||||
useEffect(() => {
|
||||
if (
|
||||
isDesktopLayout ||
|
||||
|
||||
Reference in New Issue
Block a user