feat: finalize mindspace service extraction phase a
This commit is contained in:
@@ -20,7 +20,7 @@ import { buildUserAddressPrefix } from '../utils/userAddress';
|
||||
import {
|
||||
CHAT_IMAGE_UPLOAD_MAX_INPUT_BYTES,
|
||||
} from '../utils/imageUpload';
|
||||
import { buildAbsoluteAssetImageUrl } from '../utils/mindspaceCards';
|
||||
import { buildAbsoluteAssetDownloadUrl } from '../utils/mindspaceCards';
|
||||
import { resolveAgentRunOptions } from '../utils/agentRunMode';
|
||||
import {
|
||||
buildUserMessage,
|
||||
@@ -142,10 +142,9 @@ export function usePageEditSubChat({
|
||||
sessionId: sessionRef.current?.id ?? null,
|
||||
messageId: options.messageId ?? null,
|
||||
});
|
||||
return buildAbsoluteAssetImageUrl({
|
||||
return buildAbsoluteAssetDownloadUrl({
|
||||
id: asset.id,
|
||||
updatedAt: asset.updatedAt,
|
||||
publicUrl: asset.publicUrl,
|
||||
});
|
||||
}, [resolveChatImageUploadCategoryId]);
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ import { mergeConversationSnapshot } from '../../chat-finish-sync.mjs';
|
||||
import {
|
||||
CHAT_IMAGE_UPLOAD_MAX_INPUT_BYTES,
|
||||
} from '../utils/imageUpload';
|
||||
import { buildAbsoluteAssetImageUrl } from '../utils/mindspaceCards';
|
||||
import { buildAbsoluteAssetDownloadUrl } from '../utils/mindspaceCards';
|
||||
import { resolveAgentRunOptions } from '../utils/agentRunMode';
|
||||
import {
|
||||
buildUserMessage,
|
||||
@@ -585,10 +585,9 @@ export function useTKMindChat(
|
||||
sessionId: sessionRef.current?.id ?? null,
|
||||
messageId: options.messageId ?? null,
|
||||
});
|
||||
return buildAbsoluteAssetImageUrl({
|
||||
return buildAbsoluteAssetDownloadUrl({
|
||||
id: asset.id,
|
||||
updatedAt: asset.updatedAt,
|
||||
publicUrl: asset.publicUrl,
|
||||
});
|
||||
}, [resolveChatImageUploadCategoryId]);
|
||||
|
||||
|
||||
@@ -68,6 +68,12 @@ export function buildAbsoluteAssetImageUrl(
|
||||
return `${window.location.origin}${buildAssetImageUrl(asset)}`;
|
||||
}
|
||||
|
||||
export function buildAbsoluteAssetDownloadUrl(
|
||||
asset: Pick<MindSpaceAsset, 'id' | 'updatedAt'>,
|
||||
): string {
|
||||
return `${window.location.origin}/api/mindspace/v1/assets/${asset.id}/download?inline=1&viewer=0&v=${asset.updatedAt}`;
|
||||
}
|
||||
|
||||
/** Chrome blocks PDF rendering inside any sandboxed iframe. */
|
||||
export function assetPreviewUsesSandbox(mimeType: string) {
|
||||
return mimeType !== 'application/pdf';
|
||||
|
||||
Reference in New Issue
Block a user