MCPcopy Create free account
hub / github.com/ShouChenICU/FastSend / initCurFile

Function initCurFile

app/stores/recipientTransfer.ts:142–157  ·  view source on GitHub ↗
(key?: string)

Source from the content-addressed store, hash-verified

140 }
141
142 function initCurFile(key?: string) {
143 const fileMap = peerFilesInfo.value.fileMap
144 const fileName = key || Object.keys(fileMap)[0]
145 if (!fileName || !fileMap[fileName]) {
146 throw new Error('File not found')
147 }
148
149 curFile.value = {
150 name: fileName,
151 size: fileMap[fileName]?.size || 0,
152 transmittedBytes: 0,
153 lastSize: 0,
154 speed: 0,
155 chunks: []
156 }
157 }
158
159 async function handleObjData(obj: any) {
160 if (obj.type === 'user') {

Callers 2

handleObjDataFunction · 0.85
doReceiveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected