fix chat with less than 4 qort

This commit is contained in:
PhilReact 2023-11-06 23:19:44 +02:00
parent e6165f910d
commit 54f183778e
2 changed files with 25 additions and 24 deletions

View File

@ -334,7 +334,6 @@ class ShowPlugin extends connect(store)(LitElement) {
} }
render() { render() {
console.log('this.tabs', this.tabs)
const plugSrc = (myPlug) => { const plugSrc = (myPlug) => {
return myPlug === undefined ? 'about:blank' : `${window.location.origin}/plugin/${myPlug.domain}/${myPlug.page}${this.linkParam}` return myPlug === undefined ? 'about:blank' : `${window.location.origin}/plugin/${myPlug.domain}/${myPlug.page}${this.linkParam}`
} }

View File

@ -363,9 +363,7 @@ class ChatPage extends LitElement {
} }
this.processMessages(getInitialMessages, true, false) this.processMessages(getInitialMessages, true, false)
} catch (error) { } catch (error) { /* empty */ }
console.log
}
} }
async copyJoinGroupLinkToClipboard() { async copyJoinGroupLinkToClipboard() {
@ -681,7 +679,10 @@ class ChatPage extends LitElement {
<br> <br>
<h3 style="color: var(--black);">${translate("chatpage.cchange42")}</h3> <h3 style="color: var(--black);">${translate("chatpage.cchange42")}</h3>
<div class="buttons"> <div class="buttons">
<mwc-button @click=${() => this.sendMessage(this.myTrimmedMeassage)} dialog-confirm>${translate("transpage.tchange3")}</mwc-button> <mwc-button @click=${() => {
this.sendMessage(this.myMessageUnder4Qort)
}} dialog-confirm>${translate("transpage.tchange3")}</mwc-button>
</div> </div>
</paper-dialog> </paper-dialog>
<wrapper-modal <wrapper-modal
@ -1345,6 +1346,7 @@ class ChatPage extends LitElement {
const isRecipient = this.chatId.includes('direct') === true ? true : false const isRecipient = this.chatId.includes('direct') === true ? true : false
this.chatId.includes('direct') === true ? this.isReceipient = true : this.isReceipient = false this.chatId.includes('direct') === true ? this.isReceipient = true : this.isReceipient = false
this._chatId = this.chatId.split('/')[1] this._chatId = this.chatId.split('/')[1]
const mstring = get("chatpage.cchange8") const mstring = get("chatpage.cchange8")
const placeholder = isRecipient === true ? `Message ${this._chatId}` : `${mstring}` const placeholder = isRecipient === true ? `Message ${this._chatId}` : `${mstring}`
this.chatEditorPlaceholder = placeholder this.chatEditorPlaceholder = placeholder
@ -3113,8 +3115,8 @@ class ChatPage extends LitElement {
const stringifyMessageObject = JSON.stringify(messageObject) const stringifyMessageObject = JSON.stringify(messageObject)
if (this.balance < 4) { if (this.balance < 4) {
this.myTrimmedMeassage = '' this.myMessageUnder4Qort = null
this.myTrimmedMeassage = stringifyMessageObject this.myMessageUnder4Qort = {messageText: stringifyMessageObject, typeMessage, chatReference: undefined, isForward: false, isReceipient, _chatId, _publicKey, messageQueue}
this.shadowRoot.getElementById('confirmDialog').open() this.shadowRoot.getElementById('confirmDialog').open()
} else { } else {
return this.sendMessage({messageText: stringifyMessageObject, typeMessage, chatReference: undefined, isForward: false, isReceipient, _chatId, _publicKey, messageQueue}) return this.sendMessage({messageText: stringifyMessageObject, typeMessage, chatReference: undefined, isForward: false, isReceipient, _chatId, _publicKey, messageQueue})