添加快传7天离线传

This commit is contained in:
yoyuzh
2026-03-24 09:12:10 +08:00
parent e004e64009
commit b9ab1a7640
32 changed files with 1927 additions and 81 deletions

View File

@@ -1,3 +1,4 @@
import type { TransferMode } from '../lib/types';
import type { TransferFileDescriptor } from '../lib/transfer-protocol';
export type TransferTab = 'send' | 'receive';
@@ -36,6 +37,20 @@ export function canSendTransferFiles(isAuthenticated: boolean) {
return isAuthenticated;
}
export function getTransferModeSummary(mode: TransferMode) {
if (mode === 'OFFLINE') {
return {
title: '发离线',
description: '文件先上传到站点存储,保留 7 天,到期自动销毁,可被多次接收。',
};
}
return {
title: '发在线',
description: '文件通过浏览器 P2P 直连发送,只能被接收一次,适合双方都在线时快速传输。',
};
}
export function resolveInitialTransferTab(
isAuthenticated: boolean,
sessionId: string | null,