Skip to content

Commit

Permalink
test: use filereader
Browse files Browse the repository at this point in the history
  • Loading branch information
BjrInt committed Dec 20, 2023
1 parent 27f8b46 commit 3c730a7
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/components/NodeInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,14 @@ export default {
name: 'node-info',
computed: {
editing () {
return (
this.account &&
(
this.node.owner === this.account.address ||
this.node.manager === this.account.address
)
)
return true
// return (
// this.account &&
// (
// this.node.owner === this.account.address ||
// this.node.manager === this.account.address
// )
// )
},
...mapState([
'account',
Expand Down Expand Up @@ -285,10 +286,17 @@ export default {
copyToClipboard,
ellipseAddress,
async upload_file (fileobject) {
console.log('fileloaded')
const fr = new FileReader()
fr.readAsArrayBuffer(fileobject)
let ab = await new Promise((resolve, reject) => {
fr.onload = () => resolve(fr.result)
fr.onerror = reject
})
let message = await store.submit(
this.account.address,
{
fileobject: Buffer.from(fileobject),
fileobject: Buffer.from(ab),
channel: this.channel,
api_server: this.api_server,
account: this.account
Expand Down

0 comments on commit 3c730a7

Please sign in to comment.