Browse Source

fix built issue

resolve-20231003
Phillip 1 year ago
parent
commit
826f319280
  1. 10
      core/src/components/app-info.js
  2. 16
      plugins/plugins/core/components/ChatPage.js
  3. 2
      plugins/plugins/core/messaging/q-chat/q-chat.src.js
  4. 3
      plugins/plugins/core/qdn/publish/publish.src.js
  5. 11
      plugins/plugins/utils/publish-modal.js

10
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()

16
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()

2
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 {

3
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() {

11
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();
Loading…
Cancel
Save