Skip to content

Commit

Permalink
🔀 Merge pull request #10 from nekomeowww/master
Browse files Browse the repository at this point in the history
🔖 Release 1.0.3
  • Loading branch information
nekomeowww authored Oct 4, 2020
2 parents 60ee9a9 + dd1d3a7 commit 8254d97
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<h1 align="center">ArweaveAvatar</h1>
<p align="center">Avatar upload and manage for Arweave Identification</p>
<p align="center"> Link to Permaweb: <a href="https://arweave.net/SV9JcBCwCzCUt22pX2xN6BynKi8zdaTrQ57ytu-Vems">Online</a></p>
<p align="center"> Link to Permaweb: <a href="https://arweave.net/633O1T1mQfbSCla-GzV5mqZ7hfqpU9LHAwgRvSM5r8c">Online</a></p>
<p align="center">
<img src="https://github.com/AyakaLab/ArweaveAvatar/workflows/Node%20Build%20Test/badge.svg" />
<img src="https://github.com/AyakaLab/ArweaveAvatar/workflows/Production%20CI%20Build%20Test/badge.svg" />
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>",
"private": true,
Expand Down
3 changes: 1 addition & 2 deletions src/api/arweave.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
12 changes: 9 additions & 3 deletions src/pages/Upload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div v-if='!upload' class="success-info">
<i class="el-icon-success" style="font-size: 10rem; color: #67C23A;"></i>
<span>Upload Successful!</span>
<span v-if="!upload && avatarLink !== ''" style="margin-top: 1rem;">Link to your avatar: <a :href="avatarLink">{{ avatarLink }}</a></span>
<span v-if="!upload && avatarTxDisplay !== ''" style="margin-top: 1rem;">Transaction to your avatar: <a :href="avatarTxDisplay">{{ avatarTxDisplay }}</a></span>
<img :src="getAvatar()" class="avatar"/>
</div>
</div>
Expand All @@ -32,7 +32,8 @@ export default {
return {
pct: 0,
upload: true,
custom: '#E56D9B'
custom: '#E56D9B',
avatarTxDisplay: ''
}
},
computed: {
Expand All @@ -53,6 +54,9 @@ export default {
this.upload = true
this.pct = 0
}
},
avatarLink (val) {
if (val) this.avatarTxDisplay = val
}
},
methods: {
Expand All @@ -76,7 +80,9 @@ export default {
duration: 6000
})
this.upload = false
this.uploadReset()
setTimeout(() => {
this.uploadReset()
}, 6000)
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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)
})
Expand All @@ -105,8 +107,6 @@ export default new Vuex.Store({
},
uploadReset ({ commit }) {
commit('setAvatarAfterUpload', '')
commit('setAvatarLink', '')
commit('setAvatarId', '')
commit('setUploadPct', 0)
}
}
Expand Down

0 comments on commit 8254d97

Please sign in to comment.