From 82c454a140de96d0c0647dbd6fb6ce1c240a16a6 Mon Sep 17 00:00:00 2001 From: Ayaka Neko Date: Sun, 4 Oct 2020 10:41:27 +0800 Subject: [PATCH 1/3] :sparkles: Added a more percirce error handling Signed-off-by: Ayaka Neko --- src/api/arweave.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/api/arweave.js b/src/api/arweave.js index 56975b0..21a42bd 100644 --- a/src/api/arweave.js +++ b/src/api/arweave.js @@ -60,8 +60,7 @@ let arweave = { } let detail = await this.getTransactionDetail(ids[0]).catch((err) => { - console.log(err) - resolve({ result: 'pending on confirm', error: err }) + if (JSON.parse(JSON.stringify(err)).type === 'TX_PENDING') resolve({ result: 'pending on confirm' }) }) if (!detail) { From 3e2ef5fd98214a6f84f8474e33ca8e201ed6798a Mon Sep 17 00:00:00 2001 From: Ayaka Neko Date: Sun, 4 Oct 2020 10:42:14 +0800 Subject: [PATCH 2/3] :bug: Fixed link and avatar being cleaned up immediately Signed-off-by: Ayaka Neko --- src/pages/Upload.vue | 12 +++++++++--- src/store/index.js | 6 +++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/pages/Upload.vue b/src/pages/Upload.vue index 57a1f0e..dd554d2 100644 --- a/src/pages/Upload.vue +++ b/src/pages/Upload.vue @@ -8,7 +8,7 @@
Upload Successful! - Link to your avatar: {{ avatarLink }} + Transaction to your avatar: {{ avatarTxDisplay }}
@@ -32,7 +32,8 @@ export default { return { pct: 0, upload: true, - custom: '#E56D9B' + custom: '#E56D9B', + avatarTxDisplay: '' } }, computed: { @@ -53,6 +54,9 @@ export default { this.upload = true this.pct = 0 } + }, + avatarLink (val) { + if (val) this.avatarTxDisplay = val } }, methods: { @@ -76,7 +80,9 @@ export default { duration: 6000 }) this.upload = false - this.uploadReset() + setTimeout(() => { + this.uploadReset() + }, 6000) } } } diff --git a/src/store/index.js b/src/store/index.js index ba83836..845df5c 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -74,6 +74,8 @@ export default new Vuex.Store({ commit('setAvatarFile', avatarFile) }, uploadFile ({ commit }, data) { + commit('setAvatarLink', '') + commit('setAvatarId', '') ar.createTransaction({ data: data.data }, data.key).then(async transaction => { transaction.addTag('Content-Type', data.type) transaction.addTag('App-Name', 'arweave-avatar') @@ -90,7 +92,7 @@ export default new Vuex.Store({ } commit('setAvatarId', transaction.id) - commit('setAvatarLink', 'https://arweave.net/' + transaction.id) + commit('setAvatarLink', 'http://viewblock.io/arweave/tx/' + transaction.id) await ar.transactions.post(transaction) }) @@ -105,8 +107,6 @@ export default new Vuex.Store({ }, uploadReset ({ commit }) { commit('setAvatarAfterUpload', '') - commit('setAvatarLink', '') - commit('setAvatarId', '') commit('setUploadPct', 0) } } From dd1d3a762b34306ca29990ca51dc65266c2bc639 Mon Sep 17 00:00:00 2001 From: Ayaka Neko Date: Sun, 4 Oct 2020 10:44:46 +0800 Subject: [PATCH 3/3] :bookmark: Release 1.0.3 Signed-off-by: Ayaka Neko --- README.md | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 418f372..cc396a7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@

ArweaveAvatar

Avatar upload and manage for Arweave Identification

-

Link to Permaweb: Online

+

Link to Permaweb: Online

diff --git a/package.json b/package.json index 8145716..e34fa1b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "arweave-avatar", - "version": "1.0.2", + "version": "1.0.3", "description": "Avatar upload and manage for Arweave Identification", "author": "Ayaka Neko ", "private": true,