From 826f319280727c9a43a64ef66af00e1817c01e73 Mon Sep 17 00:00:00 2001 From: Phillip Date: Fri, 18 Aug 2023 11:25:41 -0500 Subject: [PATCH] fix built issue --- core/src/components/app-info.js | 10 +++++----- plugins/plugins/core/components/ChatPage.js | 16 ++++++++++------ .../plugins/core/messaging/q-chat/q-chat.src.js | 2 -- plugins/plugins/core/qdn/publish/publish.src.js | 3 +-- plugins/plugins/utils/publish-modal.js | 11 +++++++++-- 5 files changed, 25 insertions(+), 17 deletions(-) diff --git a/core/src/components/app-info.js b/core/src/components/app-info.js index 5ce24ae7..fc2719c4 100644 --- a/core/src/components/app-info.js +++ b/core/src/components/app-info.js @@ -119,11 +119,11 @@ class AppInfo extends connect(store)(LitElement) { this.setStorage() this.getNodeInfo() this.getCoreInfo() - try { - this.confirmPublicKeyOnChain(store.getState().app.selectedAddress.address) - } catch (error) { - console.error(error) - } + // try { + // this.confirmPublicKeyOnChain(store.getState().app.selectedAddress.address) + // } catch (error) { + // console.error(error) + // } setInterval(() => { this.getNodeInfo() diff --git a/plugins/plugins/core/components/ChatPage.js b/plugins/plugins/core/components/ChatPage.js index 288337d8..0171bcf3 100644 --- a/plugins/plugins/core/components/ChatPage.js +++ b/plugins/plugins/core/components/ChatPage.js @@ -41,6 +41,7 @@ import '@material/mwc-dialog' import '@material/mwc-icon' import '@polymer/paper-dialog/paper-dialog.js' import '@polymer/paper-spinner/paper-spinner-lite.js' +import { modalHelper } from '../../utils/publish-modal.js' const chatLastSeen = localForage.createInstance({ name: "chat-last-seen", @@ -3124,7 +3125,6 @@ class ChatPage extends LitElement { } async _sendMessage(outSideMsg, msg) { - console.log({outSideMsg, msg}) try { if (this.isReceipient) { let hasPublicKey = true @@ -3252,7 +3252,9 @@ class ChatPage extends LitElement { metaData: undefined, uploadType: 'file', selectedAddress: this.selectedAddress, - worker: this.webWorkerFile + worker: this.webWorkerFile, + withFee: true, + feeAmount: arbitraryFeeData.fee }) this.isDeletingImage = false } catch (error) { @@ -3347,7 +3349,9 @@ class ChatPage extends LitElement { metaData: undefined, uploadType: 'file', selectedAddress: this.selectedAddress, - worker: this.webWorkerFile + worker: this.webWorkerFile, + withFee: true, + feeAmount: arbitraryFeeData.fee }) this.isDeletingAttachment = false } catch (error) { @@ -3386,13 +3390,11 @@ class ChatPage extends LitElement { return } const arbitraryFeeData = await modalHelper.getArbitraryFee() - console.log('updated') const res = await modalHelper.showModalAndWaitPublish( { feeAmount: arbitraryFeeData.feeToShow } ); - console.log({res}) if (res.action !== 'accept') throw new Error('User declined publish') if (this.webWorkerFile) { @@ -3529,7 +3531,9 @@ class ChatPage extends LitElement { metaData: undefined, uploadType: 'file', selectedAddress: this.selectedAddress, - worker: this.webWorkerFile + worker: this.webWorkerFile, + withFee: true, + feeAmount: arbitraryFeeData.fee }) this.isUploadingAttachment = false this.removeAttachment() diff --git a/plugins/plugins/core/messaging/q-chat/q-chat.src.js b/plugins/plugins/core/messaging/q-chat/q-chat.src.js index ca9540a8..838f42d2 100644 --- a/plugins/plugins/core/messaging/q-chat/q-chat.src.js +++ b/plugins/plugins/core/messaging/q-chat/q-chat.src.js @@ -26,12 +26,10 @@ import '@material/mwc-icon' import '@material/mwc-snackbar' import '@polymer/paper-spinner/paper-spinner-lite.js' import '@vaadin/grid' -import { ModalHelper } from '../../../utils/publish-modal.js' passiveSupport({ events: ['touchstart'] }) const parentEpml = new Epml({ type: 'WINDOW', source: window.parent }) -export const modalHelper = new ModalHelper(); class Chat extends LitElement { static get properties() { return { diff --git a/plugins/plugins/core/qdn/publish/publish.src.js b/plugins/plugins/core/qdn/publish/publish.src.js index a4662628..37710534 100644 --- a/plugins/plugins/core/qdn/publish/publish.src.js +++ b/plugins/plugins/core/qdn/publish/publish.src.js @@ -14,10 +14,9 @@ import '@material/mwc-select' import '@material/mwc-dialog' import '@material/mwc-list/mwc-list-item.js' import '@polymer/paper-progress/paper-progress.js' -import { ModalHelper } from '../../../utils/publish-modal' +import { modalHelper } from '../../../utils/publish-modal' const parentEpml = new Epml({ type: 'WINDOW', source: window.parent }) -const modalHelper = new ModalHelper(); class PublishData extends LitElement { static get properties() { diff --git a/plugins/plugins/utils/publish-modal.js b/plugins/plugins/utils/publish-modal.js index 3358083c..b55af509 100644 --- a/plugins/plugins/utils/publish-modal.js +++ b/plugins/plugins/utils/publish-modal.js @@ -26,8 +26,6 @@ export class ModalHelper { } async showModalAndWaitPublish(data) { - console.log({ data }); - return new Promise((resolve) => { const modal = this.createModal(data); document.body.appendChild(modal); @@ -260,4 +258,13 @@ export class ModalHelper { document.adoptedStyleSheets = [styleSheet]; } + + static getInstance() { + if (!ModalHelper.instance) { + ModalHelper.instance = new ModalHelper(); + } + return ModalHelper.instance; + } } + +export const modalHelper = ModalHelper.getInstance(); \ No newline at end of file