Skip to content

Commit

Permalink
fix(upload): update action to match new return shape
Browse files Browse the repository at this point in the history
  • Loading branch information
josephmcg committed May 30, 2022
1 parent 199fe53 commit bc9c40c
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions store/textile/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand All @@ -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) {
Expand All @@ -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',
},
Expand Down Expand Up @@ -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) => {
Expand All @@ -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,
Expand Down

0 comments on commit bc9c40c

Please sign in to comment.