hide img from other users unless clicked
This commit is contained in:
parent
ab00e5a8d4
commit
b6aa3aecac
@ -497,7 +497,8 @@
|
|||||||
"cchange36": "Search Results",
|
"cchange36": "Search Results",
|
||||||
"cchange37": "No Results Found",
|
"cchange37": "No Results Found",
|
||||||
"cchange38": "User Verified",
|
"cchange38": "User Verified",
|
||||||
"cchange39": "Cannot send an encrypted message to this user since they do not have their publickey on chain."
|
"cchange39": "Cannot send an encrypted message to this user since they do not have their publickey on chain.",
|
||||||
|
"cchange40": "IMAGE (click to view)"
|
||||||
},
|
},
|
||||||
"welcomepage": {
|
"welcomepage": {
|
||||||
"wcchange1": "Welcome to Q-Chat",
|
"wcchange1": "Welcome to Q-Chat",
|
||||||
|
@ -232,6 +232,7 @@ class MessageTemplate extends LitElement {
|
|||||||
isLastMessageInGroup: { type: Boolean },
|
isLastMessageInGroup: { type: Boolean },
|
||||||
setToggledMessage: {attribute: false},
|
setToggledMessage: {attribute: false},
|
||||||
setForwardProperties: {attribute: false},
|
setForwardProperties: {attribute: false},
|
||||||
|
viewImage: {type: Boolean}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -248,6 +249,7 @@ class MessageTemplate extends LitElement {
|
|||||||
this.isFirstMessage = false
|
this.isFirstMessage = false
|
||||||
this.isSingleMessageInGroup = false
|
this.isSingleMessageInGroup = false
|
||||||
this.isLastMessageInGroup = false
|
this.isLastMessageInGroup = false
|
||||||
|
this.viewImage = false
|
||||||
}
|
}
|
||||||
|
|
||||||
static styles = [chatStyles]
|
static styles = [chatStyles]
|
||||||
@ -352,9 +354,13 @@ class MessageTemplate extends LitElement {
|
|||||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node];
|
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node];
|
||||||
const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
|
const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
|
||||||
imageUrl = `${nodeUrl}/arbitrary/${image.service}/${image.name}/${image.identifier}?async=true&apiKey=${myNode.apiKey}`;
|
imageUrl = `${nodeUrl}/arbitrary/${image.service}/${image.name}/${image.identifier}?async=true&apiKey=${myNode.apiKey}`;
|
||||||
imageHTML = createImage(imageUrl);
|
|
||||||
imageHTMLDialog = createImage(imageUrl);
|
if(this.viewImage || this.myAddress === this.messageObj.sender){
|
||||||
imageHTMLDialog.style= "height: auto; max-height: 80vh; width: auto; max-width: 80vw; object-fit: contain; border-radius: 5px";
|
imageHTML = createImage(imageUrl);
|
||||||
|
imageHTMLDialog = createImage(imageUrl)
|
||||||
|
imageHTMLDialog.style= "height: auto; max-height: 80vh; width: auto; max-width: 80vw; object-fit: contain; border-radius: 5px";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nameMenu = html`
|
nameMenu = html`
|
||||||
@ -453,7 +459,20 @@ class MessageTemplate extends LitElement {
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
`}
|
`}
|
||||||
${image && !isImageDeleted ? html`
|
${image && !isImageDeleted && !this.viewImage && this.myAddress !== this.messageObj.sender ? html`
|
||||||
|
<div
|
||||||
|
@click=${()=> {
|
||||||
|
this.viewImage = true
|
||||||
|
}}
|
||||||
|
class=${[`image-container`, !this.isImageLoaded ? 'defaultSize' : ''].join(' ')}
|
||||||
|
style=${this.isFirstMessage && "margin-top: 10px;"}>
|
||||||
|
<div style="display:flex;width:100%;height:100%;justify-content:center;align-items:center;cursor:pointer;color:var(--black)">
|
||||||
|
${translate("chatpage.cchange40")}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
` : html``}
|
||||||
|
${image && !isImageDeleted && (this.viewImage || this.myAddress === this.messageObj.sender) ? html`
|
||||||
<div
|
<div
|
||||||
class=${[`image-container`, !this.isImageLoaded ? 'defaultSize' : ''].join(' ')}
|
class=${[`image-container`, !this.isImageLoaded ? 'defaultSize' : ''].join(' ')}
|
||||||
style=${this.isFirstMessage && "margin-top: 10px;"}>
|
style=${this.isFirstMessage && "margin-top: 10px;"}>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user