diff --git a/store/textile/actions.ts b/store/textile/actions.ts index 4bf6f0b83a..f0001e4eeb 100644 --- a/store/textile/actions.ts +++ b/store/textile/actions.ts @@ -321,7 +321,7 @@ export default { document.body.style.cursor = PropCommonEnum.WAIT const $TextileManager: TextileManager = Vue.prototype.$TextileManager const id = uuidv4() - const path = await $TextileManager.sharedBucket?.pushFile( + const res = await $TextileManager.sharedBucket?.pushFile( file.file, id, (progress: number) => { @@ -333,7 +333,6 @@ export default { ) /* If already canceled */ if (!rootState.textile.messageLoading) return - const fileURL = Config.textile.browser + path const friend = rootState.friends.all.find((fr) => fr.textilePubkey === to) if (!friend) { @@ -345,11 +344,11 @@ export default { { to: friend.textilePubkey, payload: { - url: fileURL, + id, + url: Config.textile.browser + res?.path.path, name: file.file.name, size: file.file.size, type: file.file.type, - id, }, type: 'file', }, @@ -840,7 +839,7 @@ export default { const $TextileManager: TextileManager = Vue.prototype.$TextileManager const group = getGroup(rootState, groupID) const id = uuidv4() - const path = await $TextileManager.sharedBucket?.pushFile( + const res = await $TextileManager.sharedBucket?.pushFile( file.file, id, (progress: number) => { @@ -850,13 +849,13 @@ export default { }) }, ) - const fileURL = Config.textile.browser + path const sendFileResult = await $TextileManager.groupChatManager?.sendMessage<'file'>(group, { to: groupID, payload: { - url: fileURL, + id, + url: Config.textile.browser + res?.path.path, name: file.file.name, size: file.file.size, type: file.file.type,