Skip to content

Commit 8254d97

Browse files
authored
🔀 Merge pull request #10 from nekomeowww/master
🔖 Release 1.0.3
2 parents 60ee9a9 + dd1d3a7 commit 8254d97

File tree

5 files changed

+15
-10
lines changed

5 files changed

+15
-10
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<h1 align="center">ArweaveAvatar</h1>
22
<p align="center">Avatar upload and manage for Arweave Identification</p>
3-
<p align="center"> Link to Permaweb: <a href="https://arweave.net/SV9JcBCwCzCUt22pX2xN6BynKi8zdaTrQ57ytu-Vems">Online</a></p>
3+
<p align="center"> Link to Permaweb: <a href="https://arweave.net/633O1T1mQfbSCla-GzV5mqZ7hfqpU9LHAwgRvSM5r8c">Online</a></p>
44
<p align="center">
55
<img src="https://github.com/AyakaLab/ArweaveAvatar/workflows/Node%20Build%20Test/badge.svg" />
66
<img src="https://github.com/AyakaLab/ArweaveAvatar/workflows/Production%20CI%20Build%20Test/badge.svg" />

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "arweave-avatar",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "Avatar upload and manage for Arweave Identification",
55
"author": "Ayaka Neko <[email protected]>",
66
"private": true,

src/api/arweave.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ let arweave = {
6060
}
6161

6262
let detail = await this.getTransactionDetail(ids[0]).catch((err) => {
63-
console.log(err)
64-
resolve({ result: 'pending on confirm', error: err })
63+
if (JSON.parse(JSON.stringify(err)).type === 'TX_PENDING') resolve({ result: 'pending on confirm' })
6564
})
6665

6766
if (!detail) {

src/pages/Upload.vue

+9-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<div v-if='!upload' class="success-info">
99
<i class="el-icon-success" style="font-size: 10rem; color: #67C23A;"></i>
1010
<span>Upload Successful!</span>
11-
<span v-if="!upload && avatarLink !== ''" style="margin-top: 1rem;">Link to your avatar: <a :href="avatarLink">{{ avatarLink }}</a></span>
11+
<span v-if="!upload && avatarTxDisplay !== ''" style="margin-top: 1rem;">Transaction to your avatar: <a :href="avatarTxDisplay">{{ avatarTxDisplay }}</a></span>
1212
<img :src="getAvatar()" class="avatar"/>
1313
</div>
1414
</div>
@@ -32,7 +32,8 @@ export default {
3232
return {
3333
pct: 0,
3434
upload: true,
35-
custom: '#E56D9B'
35+
custom: '#E56D9B',
36+
avatarTxDisplay: ''
3637
}
3738
},
3839
computed: {
@@ -53,6 +54,9 @@ export default {
5354
this.upload = true
5455
this.pct = 0
5556
}
57+
},
58+
avatarLink (val) {
59+
if (val) this.avatarTxDisplay = val
5660
}
5761
},
5862
methods: {
@@ -76,7 +80,9 @@ export default {
7680
duration: 6000
7781
})
7882
this.upload = false
79-
this.uploadReset()
83+
setTimeout(() => {
84+
this.uploadReset()
85+
}, 6000)
8086
}
8187
}
8288
}

src/store/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ export default new Vuex.Store({
7474
commit('setAvatarFile', avatarFile)
7575
},
7676
uploadFile ({ commit }, data) {
77+
commit('setAvatarLink', '')
78+
commit('setAvatarId', '')
7779
ar.createTransaction({ data: data.data }, data.key).then(async transaction => {
7880
transaction.addTag('Content-Type', data.type)
7981
transaction.addTag('App-Name', 'arweave-avatar')
@@ -90,7 +92,7 @@ export default new Vuex.Store({
9092
}
9193

9294
commit('setAvatarId', transaction.id)
93-
commit('setAvatarLink', 'https://arweave.net/' + transaction.id)
95+
commit('setAvatarLink', 'http://viewblock.io/arweave/tx/' + transaction.id)
9496

9597
await ar.transactions.post(transaction)
9698
})
@@ -105,8 +107,6 @@ export default new Vuex.Store({
105107
},
106108
uploadReset ({ commit }) {
107109
commit('setAvatarAfterUpload', '')
108-
commit('setAvatarLink', '')
109-
commit('setAvatarId', '')
110110
commit('setUploadPct', 0)
111111
}
112112
}

0 commit comments

Comments
 (0)