From 27f8b46204ddf9aee3af546a94baf037700adec9 Mon Sep 17 00:00:00 2001 From: Bonjour Internet Date: Wed, 20 Dec 2023 16:11:03 +0100 Subject: [PATCH 1/3] fix: (test) banner update --- src/components/NodeInfo.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/NodeInfo.vue b/src/components/NodeInfo.vue index 1175804..1cd2bc8 100644 --- a/src/components/NodeInfo.vue +++ b/src/components/NodeInfo.vue @@ -237,6 +237,7 @@ import ResourceNodeName from './ResourceNodeName.vue' import CoreNodeName from './CoreNodeName.vue' import { diagnoseMetrics, ellipseAddress, timeUntilNextScoreMessage } from '../helpers/utilities' import { copyToClipboard } from 'quasar' +import { Buffer } from 'buffer' export default { components: { ResourceNodeName, CoreNodeName }, @@ -287,7 +288,7 @@ export default { let message = await store.submit( this.account.address, { - fileobject: fileobject, + fileobject: Buffer.from(fileobject), channel: this.channel, api_server: this.api_server, account: this.account From 3c730a745fcc8b1078d689c574e2a06c37eb94bd Mon Sep 17 00:00:00 2001 From: Bonjour Internet Date: Wed, 20 Dec 2023 16:35:28 +0100 Subject: [PATCH 2/3] test: use filereader --- src/components/NodeInfo.vue | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/components/NodeInfo.vue b/src/components/NodeInfo.vue index 1cd2bc8..988e844 100644 --- a/src/components/NodeInfo.vue +++ b/src/components/NodeInfo.vue @@ -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', @@ -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 From e5ff22d32fbde4ae657e0c4388586d6aad4f7fed Mon Sep 17 00:00:00 2001 From: Bonjour Internet Date: Wed, 20 Dec 2023 17:32:55 +0100 Subject: [PATCH 3/3] test --- src/components/NodeInfo.vue | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/components/NodeInfo.vue b/src/components/NodeInfo.vue index 988e844..f8b95b3 100644 --- a/src/components/NodeInfo.vue +++ b/src/components/NodeInfo.vue @@ -286,13 +286,7 @@ 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 ab = await fileobject.arrayBuffer() let message = await store.submit( this.account.address, {