Merge branch 'feature/group-features' into feature/new-editor

This commit is contained in:
Phillip 2023-01-13 22:04:31 -05:00
commit 17d0efefaa
7 changed files with 385 additions and 209 deletions

View File

@ -93,46 +93,46 @@
"selectfile": "Select file",
"dragfile": "Drag and drop backup here"
},
"settings":{
"generalinfo":"General Account Info",
"address":"Address",
"publickey":"Public Key",
"settings":"Settings",
"account":"Account",
"security":"Security",
"qr_login_menu_item":"QR Login",
"qr_login_description_1":"Scan this code to unlock your wallet on other device using the same password which you logged in with.",
"qr_login_description_2":"Choose a password which you will use to unlock your wallet on other device after scanning the QR code.",
"qr_login_button_1":"Show login QR code",
"qr_login_button_2":"Generate login QR code",
"notifications":"Notifications",
"accountsecurity":"Account Security",
"password":"Password",
"download":"Download Backup File",
"choose":"Please choose a password to encrypt your backup with. (This can be the same as the one you logged in with, or different)",
"block":"Block Notifications (Coming Soon...)",
"playsound":"Play Sound",
"shownotifications":"Show Notifications",
"nodeurl":"Node Url",
"nodehint":"Select a node from the default list of nodes above or add a custom node to the list above by clicking on the button below",
"addcustomnode":"Add Custom Node",
"addandsave":"Add And Save",
"protocol":"Protocol",
"domain":"Domain",
"port":"Port",
"import":"Import Nodes",
"export":"Export Nodes",
"deletecustomnode":"Remove All Custom Nodes",
"warning":"Your existing nodes will be deleted and from backup new created.",
"snack1":"Successfully deleted and added standard nodes",
"snack2":"UI conected to node",
"snack3":"Successfully added and saved custom node",
"snack4":"Nodes successfully saved as",
"snack5":"Nodes successfully imported",
"exp1":"Export Private Master Key",
"exp2":"Export Master Key",
"exp3":"Export",
"exp4":"Please choose a wallet to backup the private master key."
"settings": {
"generalinfo": "General Account Info",
"address": "Address",
"publickey": "Public Key",
"settings": "Settings",
"account": "Account",
"security": "Security",
"qr_login_menu_item": "QR Login",
"qr_login_description_1": "Scan this code to unlock your wallet on other device using the same password which you logged in with.",
"qr_login_description_2": "Choose a password which you will use to unlock your wallet on other device after scanning the QR code.",
"qr_login_button_1": "Show login QR code",
"qr_login_button_2": "Generate login QR code",
"notifications": "Notifications",
"accountsecurity": "Account Security",
"password": "Password",
"download": "Download Backup File",
"choose": "Please choose a password to encrypt your backup with. (This can be the same as the one you logged in with, or different)",
"block": "Block Notifications (Coming Soon...)",
"playsound": "Play Sound",
"shownotifications": "Show Notifications",
"nodeurl": "Node Url",
"nodehint": "Select a node from the default list of nodes above or add a custom node to the list above by clicking on the button below",
"addcustomnode": "Add Custom Node",
"addandsave": "Add And Save",
"protocol": "Protocol",
"domain": "Domain",
"port": "Port",
"import": "Import Nodes",
"export": "Export Nodes",
"deletecustomnode": "Remove All Custom Nodes",
"warning": "Your existing nodes will be deleted and from backup new created.",
"snack1": "Successfully deleted and added standard nodes",
"snack2": "UI conected to node",
"snack3": "Successfully added and saved custom node",
"snack4": "Nodes successfully saved as",
"snack5": "Nodes successfully imported",
"exp1": "Export Private Master Key",
"exp2": "Export Master Key",
"exp3": "Export",
"exp4": "Please choose a wallet to backup the private master key."
},
"appinfo": {
"blockheight": "Block Height",
@ -285,56 +285,56 @@
"wchange56": "WARNING!",
"wchange57": "Memo"
},
"tradepage":{
"tchange1":"Trade Portal",
"tchange2":"Select Trading Pair",
"tchange3":"HISTORIC MARKET TRADES",
"tchange4":"MY TRADE HISTORY",
"tchange5":"OPEN MARKET SELL ORDERS",
"tchange6":"MY ORDERS",
"tchange7":"Stuck Offers",
"tchange8":"Amount",
"tchange9":"Price",
"tchange10":"Total",
"tchange11":"Date",
"tchange12":"Status",
"tchange13":"Seller",
"tchange14":"Price Each",
"tchange15":"Clear Form",
"tchange16":"You have",
"tchange17":"Action",
"tchange18":"BUY",
"tchange19":"SELL",
"tchange20":"Failed to Create Trade. Try again!",
"tchange21":"Failed to Create Trade. Error Code",
"tchange22":"Insufficient Funds!",
"tchange23":"Buy Request Successful!",
"tchange24":"Buy Request Existing!",
"tchange25":"Failed to Create Trade. Error Code",
"tchange26":"Trade Cancelling In Progress!",
"tchange27":"Failed to Cancel Trade. Try again!",
"tchange28":"Failed to Cancel Trade. Error Code",
"tchange29":"CANCEL",
"tchange30":"Failed to Fetch Balance. Try again!",
"tchange31":"SOLD",
"tchange32":"BOUGHT",
"tchange33":"Average",
"tchange34":"Amount can not be 0",
"tchange35":"Price can not be 0",
"tchange36":"PENDING AUTO BUY",
"tchange37":"No auto buy order found !",
"tchange38":"ADD",
"tchange39":"AUTO BUY ORDER",
"tchange40":"Price",
"tchange41":"Successfully removed auto buy order!",
"tchange42":"MARKET OPEN SELL ORDERS",
"tchange43":"MY BUY HISTORY",
"tchange44":"Successfully added auto buy order!",
"tchange45":"AUTO BUY WITH",
"tchange46":"AUTO BUY",
"tchange47":"Sell for this price",
"tchange48":"NOT ENOUGH",
"tchange49":"Price Chart"
"tradepage": {
"tchange1": "Trade Portal",
"tchange2": "Select Trading Pair",
"tchange3": "HISTORIC MARKET TRADES",
"tchange4": "MY TRADE HISTORY",
"tchange5": "OPEN MARKET SELL ORDERS",
"tchange6": "MY ORDERS",
"tchange7": "Stuck Offers",
"tchange8": "Amount",
"tchange9": "Price",
"tchange10": "Total",
"tchange11": "Date",
"tchange12": "Status",
"tchange13": "Seller",
"tchange14": "Price Each",
"tchange15": "Clear Form",
"tchange16": "You have",
"tchange17": "Action",
"tchange18": "BUY",
"tchange19": "SELL",
"tchange20": "Failed to Create Trade. Try again!",
"tchange21": "Failed to Create Trade. Error Code",
"tchange22": "Insufficient Funds!",
"tchange23": "Buy Request Successful!",
"tchange24": "Buy Request Existing!",
"tchange25": "Failed to Create Trade. Error Code",
"tchange26": "Trade Cancelling In Progress!",
"tchange27": "Failed to Cancel Trade. Try again!",
"tchange28": "Failed to Cancel Trade. Error Code",
"tchange29": "CANCEL",
"tchange30": "Failed to Fetch Balance. Try again!",
"tchange31": "SOLD",
"tchange32": "BOUGHT",
"tchange33": "Average",
"tchange34": "Amount can not be 0",
"tchange35": "Price can not be 0",
"tchange36": "PENDING AUTO BUY",
"tchange37": "No auto buy order found !",
"tchange38": "ADD",
"tchange39": "AUTO BUY ORDER",
"tchange40": "Price",
"tchange41": "Successfully removed auto buy order!",
"tchange42": "MARKET OPEN SELL ORDERS",
"tchange43": "MY BUY HISTORY",
"tchange44": "Successfully added auto buy order!",
"tchange45": "AUTO BUY WITH",
"tchange46": "AUTO BUY",
"tchange47": "Sell for this price",
"tchange48": "NOT ENOUGH",
"tchange49": "Price Chart"
},
"rewardsharepage": {
"rchange1": "Rewardshares",
@ -566,8 +566,11 @@
"cchange57": "User Info",
"cchange58": "SEND MESSAGE",
"cchange59": "TIP USER",
"cchange60": "Enter Enabled",
"cchange61": "Enter Disabled"
"cchange60": "Group Invites Pending",
"cchange61": "Error when fetching group invites. Please try again!",
"cchange62": "Wrong Username and Address Inputted! Please try again!",
"cchange63": "Enter Enabled",
"cchange64": "Enter Disabled"
},
"welcomepage": {
"wcchange1": "Welcome to Q-Chat",
@ -794,67 +797,67 @@
"exp20": "Received",
"exp21": "Trades"
},
"managegroup":{
"mg1":"Group Members",
"mg2":"Invite To Group",
"mg3":"Group Admins",
"mg4":"Update Group",
"mg5":"Close Manage Group",
"mg6":"BAN",
"mg7":"KICK",
"mg8":"Group ID",
"mg9":"Joined",
"mg10":"Add Group Admin",
"mg11":"Are you sure to add this member to admins ?",
"mg12":"On pressing confirm, add admin request will be sent!",
"mg13":"Remove Group Admin",
"mg14":"Remove Admin Address",
"mg15":"Are you sure to remove this member from admins ?",
"mg16":"On pressing confirm, remove admin request will be sent!",
"mg17":"Ban Member From Group",
"mg18":"Member Name",
"mg19":"Member Address",
"mg20":"How Long To Ban",
"mg21":"Reason For Ban",
"mg22":"Are you sure to ban this member from the group ?",
"mg23":"On pressing confirm, the ban request will be sent!",
"mg24":"FOREVER",
"mg25":"Banned Members",
"mg26":"CANCEL BAN",
"mg27":"Ban Expiry",
"mg28":"Cancel Ban Member From Group",
"mg29":"Are you sure to cancel the ban for this member from the group ?",
"mg30":"On pressing confirm, the cancel ban request will be sent!",
"mg31":"Kick Member From Group",
"mg32":"Reason For Kick",
"mg33":"Are you sure to kick this member from the group ?",
"mg34":"On pressing confirm, the kick request will be sent!",
"mg35":"No Open Group Invites",
"mg36":"Your Open Group Invites",
"mg37":"Address or name to invite",
"mg38":"Invite Expiry Time",
"mg39":"All Fields Are Required",
"mg40":"Are you sure to invite this member to the group ?",
"mg41":"On pressing confirm, the invite request will be sent!",
"mg42":"Group Type",
"mg43":"Invite Expiry",
"mg44":"Public Group",
"mg45":"Private Group",
"mg46":"Cancel Invite",
"mg47":"Cancel Invite To Group",
"mg48":"Are you sure to cancel the invite for this member ?",
"mg49":"On pressing confirm, the cancel invite request will be sent!",
"mg50":"Coming Soon...",
"mg51":"Minimum 3 Characters / Maximum 32 Characters",
"mg52":"Maximum 128 Characters",
"mg53":"Your Open Join Requests",
"mg54":"No Open Join Requests",
"mg55":"Are you sure to accept the join request from this member ?",
"mg56":"On pressing confirm, the accept join request will be sent!",
"mg57":"Join Request Successfully Accepted",
"mg58":"SOMETHING WENT WRONG",
"mg59":"Cancel Join Request Successfully Accepted",
"mg60":"Are you sure to cancel the join request from this member ?",
"mg61":"On pressing confirm, the cancel join request will be sent!"
"managegroup": {
"mg1": "Group Members",
"mg2": "Invite To Group",
"mg3": "Group Admins",
"mg4": "Update Group",
"mg5": "Close Manage Group",
"mg6": "BAN",
"mg7": "KICK",
"mg8": "Group ID",
"mg9": "Joined",
"mg10": "Add Group Admin",
"mg11": "Are you sure to add this member to admins ?",
"mg12": "On pressing confirm, add admin request will be sent!",
"mg13": "Remove Group Admin",
"mg14": "Remove Admin Address",
"mg15": "Are you sure to remove this member from admins ?",
"mg16": "On pressing confirm, remove admin request will be sent!",
"mg17": "Ban Member From Group",
"mg18": "Member Name",
"mg19": "Member Address",
"mg20": "How Long To Ban",
"mg21": "Reason For Ban",
"mg22": "Are you sure to ban this member from the group ?",
"mg23": "On pressing confirm, the ban request will be sent!",
"mg24": "FOREVER",
"mg25": "Banned Members",
"mg26": "CANCEL BAN",
"mg27": "Ban Expiry",
"mg28": "Cancel Ban Member From Group",
"mg29": "Are you sure to cancel the ban for this member from the group ?",
"mg30": "On pressing confirm, the cancel ban request will be sent!",
"mg31": "Kick Member From Group",
"mg32": "Reason For Kick",
"mg33": "Are you sure to kick this member from the group ?",
"mg34": "On pressing confirm, the kick request will be sent!",
"mg35": "No Open Group Invites",
"mg36": "Your Open Group Invites",
"mg37": "Address or name to invite",
"mg38": "Invite Expiry Time",
"mg39": "All Fields Are Required",
"mg40": "Are you sure to invite this member to the group ?",
"mg41": "On pressing confirm, the invite request will be sent!",
"mg42": "Group Type",
"mg43": "Invite Expiry",
"mg44": "Public Group",
"mg45": "Private Group",
"mg46": "Cancel Invite",
"mg47": "Cancel Invite To Group",
"mg48": "Are you sure to cancel the invite for this member ?",
"mg49": "On pressing confirm, the cancel invite request will be sent!",
"mg50": "Coming Soon...",
"mg51": "Minimum 3 Characters / Maximum 32 Characters",
"mg52": "Maximum 128 Characters",
"mg53": "Your Open Join Requests",
"mg54": "No Open Join Requests",
"mg55": "Are you sure to accept the join request from this member ?",
"mg56": "On pressing confirm, the accept join request will be sent!",
"mg57": "Join Request Successfully Accepted",
"mg58": "SOMETHING WENT WRONG",
"mg59": "Cancel Join Request Successfully Accepted",
"mg60": "Are you sure to cancel the join request from this member ?",
"mg61": "On pressing confirm, the cancel join request will be sent!"
}
}

View File

@ -229,9 +229,9 @@ class ChatGroupsManagement extends LitElement {
render() {
return html`
<vaadin-icon @click=${()=> {
<!-- <vaadin-icon @click=${()=> {
this.isOpenLeaveModal = true
}} class="top-bar-icon" style="margin: 0px 20px" icon="vaadin:exit" slot="icon"></vaadin-icon>
}} class="top-bar-icon" style="margin: 0px 20px" icon="vaadin:exit" slot="icon"></vaadin-icon> -->
<!-- Leave Group Dialog -->
<wrapper-modal
.removeImage=${() => {

View File

@ -1108,8 +1108,10 @@ class ChatPage extends LitElement {
id="sendTo"
placeholder="${translate("chatpage.cchange7")}"
@keydown=${() => {
this.forwardActiveChatHeadUrl = {};
this.requestUpdate();
if (this.forwardActiveChatHeadUrl.selected) {
this.forwardActiveChatHeadUrl = {};
this.requestUpdate();
}
}
}
/>
@ -1374,7 +1376,8 @@ class ChatPage extends LitElement {
const nameValue = this.shadowRoot.getElementById('sendTo').value;
if (!nameValue) {
this.userFound = [];
this.userFoundModalOpen = true;
this.userFoundModalOpen = false;
this.loading = false;
return;
}
try {
@ -1384,6 +1387,7 @@ class ChatPage extends LitElement {
})
if (result.error === 401) {
this.userFound = [];
this.loading = false;
} else {
this.userFound = [
...this.userFound,
@ -1392,6 +1396,7 @@ class ChatPage extends LitElement {
}
this.userFoundModalOpen = true;
} catch (error) {
this.loading = false;
console.error(error);
let err4string = get("chatpage.cchange35");
parentEpml.request('showSnackBar', `${err4string}`)
@ -1613,23 +1618,23 @@ class ChatPage extends LitElement {
}
async getName (recipient) {
try {
const getNames = await parentEpml.request("apiCall", {
type: "api",
url: `/names/address/${recipient}`,
});
async getName (recipient) {
try {
const getNames = await parentEpml.request("apiCall", {
type: "api",
url: `/names/address/${recipient}`,
});
if (Array.isArray(getNames) && getNames.length > 0 ) {
return getNames[0].name
} else {
return ''
if (Array.isArray(getNames) && getNames.length > 0 ) {
return getNames[0].name
} else {
return ''
}
} catch (error) {
return ""
}
} catch (error) {
return ""
}
}
async renderPlaceholder() {
const getName = async (recipient)=> {
@ -2538,9 +2543,9 @@ async getName (recipient) {
};
if (this.forwardActiveChatHeadUrl.url) {
const activeChatHeadAddress = this.forwardActiveChatHeadUrl.url.split('/')[1]
const activeChatHeadAddress = this.forwardActiveChatHeadUrl.url.split('/')[1];
try {
const res = await parentEpml.request('apiCall', {
const res = await parentEpml.request('apiCall', {
type: 'api',
url: `/addresses/publickey/${activeChatHeadAddress}`
})
@ -2560,21 +2565,58 @@ async getName (recipient) {
}
}
if (!this.forwardActiveChatHeadUrl && this.shadowRoot.getElementById("sendTo").value !== "") {
if (!this.forwardActiveChatHeadUrl.selected && this.shadowRoot.getElementById("sendTo").value !== "") {
const userInput = this.shadowRoot.getElementById("sendTo").value.trim();
try {
const res = await parentEpml.request('apiCall', {
let userPubkey = "";
const validatedAddress = await parentEpml.request('apiCall', {
type: 'api',
url: `/addresses/publickey/${this.shadowRoot.getElementById("sendTo").value}`
})
if (res.error === 102) {
publicKey.key = ''
publicKey.hasPubKey = false
} else if (res !== false) {
publicKey.key = res
publicKey.hasPubKey = true
url: `/addresses/validate/${userInput}`
});
const validatedUsername = await parentEpml.request('apiCall', {
type: 'api',
url: `/names/${userInput}`
});
if (!validatedAddress && validatedUsername) {
userPubkey = await parentEpml.request('apiCall', {
type: 'api',
url: `/addresses/publickey/${validatedUsername.owner}`
});
this.forwardActiveChatHeadUrl = {
...this.forwardActiveChatHeadUrl,
url: `direct/${validatedUsername.owner}`,
name: validatedUsername.name,
selected: true
};
} else if (validatedAddress && !validatedUsername.name) {
userPubkey = await parentEpml.request('apiCall', {
type: 'api',
url: `/addresses/publickey/${userInput}`
});
this.forwardActiveChatHeadUrl = {
...this.forwardActiveChatHeadUrl,
url: `direct/${userInput}`,
name: "",
selected: true
};
} else if (!validatedAddress && !validatedUsername.name) {
let err4string = get("chatpage.cchange62");
parentEpml.request('showSnackBar', `${err4string}`);
getSendChatResponse(false);
return;
}
if (userPubkey.error === 102) {
publicKey.key = '';
publicKey.hasPubKey = false;
} else if (userPubkey !== false) {
publicKey.key = userPubkey;
publicKey.hasPubKey = true;
} else {
publicKey.key = ''
publicKey.hasPubKey = false
publicKey.key = '';
publicKey.hasPubKey = false;
}
} catch (error) {
console.error(error);
@ -2588,9 +2630,9 @@ async getName (recipient) {
if (isRecipient === true) {
if(!publicKey.hasPubKey){
let err4string = get("chatpage.cchange39");
parentEpml.request('showSnackBar', `${err4string}`)
getSendChatResponse(false)
return
parentEpml.request('showSnackBar', `${err4string}`);
getSendChatResponse(false);
return;
}
let chatResponse = await parentEpml.request('chat', {
type: 18,
@ -2678,6 +2720,8 @@ async getName (recipient) {
} else {
let err2string = get("chatpage.cchange21");
parentEpml.request('showSnackBar', `${err2string}`);
this.forwardActiveChatHeadUrl = {};
this.shadowRoot.getElementById("sendTo").value = "";
}
this.isLoading = false;

View File

@ -416,9 +416,9 @@ class ChatTextEditor extends LitElement {
class=${["chatbar-button-single",(this.editedMessageObj || this.repliedToMessageObj) && 'show-chatbar-buttons', this.editor && this.editor.isActive('codeBlock') ? 'is-active' : ''].join(' ')}
>
${this.isEnabledChatEnter ? html`
${translate("chatpage.cchange60")}
${translate("chatpage.cchange63")}
` : html`
${translate("chatpage.cchange61")}
${translate("chatpage.cchange64")}
`}
</button>

View File

@ -55,7 +55,7 @@ export class UserInfo extends LitElement {
render() {
let avatarImg = "";
if (this.selectedHead.name) {
if (this.selectedHead && this.selectedHead.name) {
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 avatarUrl = `${nodeUrl}/arbitrary/THUMBNAIL/${this.selectedHead.name}/qortal_avatar?async=true&apiKey=${myNode.apiKey}`;
@ -78,7 +78,7 @@ export class UserInfo extends LitElement {
${avatarImg}
</div>` :
html``}
${!this.isImageLoaded && this.selectedHead.name ?
${!this.isImageLoaded && this.selectedHead && this.selectedHead.name ?
html`
<div class="avatar-container">
<div class="user-info-no-avatar">
@ -87,16 +87,14 @@ export class UserInfo extends LitElement {
</div>
`
: ""}
${!this.isImageLoaded && !this.selectedHead.name ?
${!this.isImageLoaded && this.selectedHead && !this.selectedHead.name ?
html`
<div
class="avatar-container"
>
<div class="avatar-container">
<img src="/img/qortal-chat-logo.png" alt="avatar" />
</div>`
: ""}
<div class="user-info-header">
${this.selectedHead.name ? this.selectedHead.name : cropAddress(this.selectedHead.address)}
${this.selectedHead && this.selectedHead.name ? this.selectedHead.name : this.selectedHead ? cropAddress(this.selectedHead.address) : null}
</div>
<div
class="send-message-button"

View File

@ -54,10 +54,103 @@ export const qchatStyles = css`
position: absolute;
bottom: 0;
width: 20vw;
height: 60px;
background: var(--white);
border-top: 1px solid var(--border);
border-right: 3px #ddd solid;
display: flex;
justify-content: space-between;
gap: 15px;
flex-direction: column;
padding: 5px 30px 0 30px;
}
.groups-button-container {
position: relative;
}
.groups-button {
width: 100%;
background-color: rgb(116, 69, 240);
border: none;
color: white;
font-weight: bold;
font-family: 'Roboto';
letter-spacing: 0.8px;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
border-radius: 5px;
gap: 10px;
padding: 5px 8px;
transition: all 0.1s ease-in-out;
}
.groups-button-notif {
position: absolute;
top: -10px;
right: -8px;
width: 25px;
border-radius: 50%;
height: 25px;
font-weight: bold;
display: flex;
align-items: center;
justify-content: center;
font-family: Montserrat, sans-serif;
font-size: 16px;
font-weight: bold;
color: black;
background-color: rgb(51, 213, 0);
user-select: none;
transition: all 0.3s ease-in-out 0s;
}
.groups-button-notif:hover {
cursor: auto;
box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
}
.groups-button-notif:hover + .groups-button-notif-number {
display: block;
opacity: 1;
animation: fadeIn 0.6s;
}
@keyframes fadeIn {
from {
opacity: 0;
top: -10px;
}
to {
opacity: 1;
top: -60px;
}
}
.groups-button-notif-number {
position: absolute;
transform: translateX(-50%);
left: 50%;
width: 150px;
text-align: center;
border-radius: 3px;
padding: 5px 10px;
background-color: white;
color: black;
font-family: Roboto, sans-serif;
letter-spacing: 0.3px;
font-weight: 300;
display: none;
opacity: 0;
top: -60px;
box-shadow: rgb(216 216 216 / 25%) 0px 6px 12px -2px, rgb(0 0 0 / 30%) 0px 3px 7px -3px;
}
.groups-button:hover {
cursor: pointer;
filter: brightness(120%);
}
.people-list .search {

View File

@ -51,7 +51,8 @@ class Chat extends LitElement {
userFound: { type: Array},
userFoundModalOpen: { type: Boolean },
userSelected: { type: Object },
editor: {type: Object}
editor: {type: Object},
groupInvites: { type: Array }
}
}
@ -90,13 +91,14 @@ class Chat extends LitElement {
this.userFound = []
this.userFoundModalOpen = false
this.userSelected = {}
this.groupInvites = []
}
async setActiveChatHeadUrl(url) {
this.activeChatHeadUrl = ''
await this.updateComplete;
this.activeChatHeadUrl = url
}
}
resetChatEditor(){
@ -177,9 +179,30 @@ class Chat extends LitElement {
${this.isEmptyArray(this.chatHeads) ? this.renderLoadingText() : this.renderChatHead(this.chatHeads)}
</ul>
<div class="blockedusers">
<div class="center">
<mwc-button raised label="${translate("chatpage.cchange3")}" icon="person_off" @click=${() => this.shadowRoot.querySelector('#blockedUserDialog').show()}></mwc-button>
<div class="groups-button-container">
<a href="/app/group-management">
<button class="groups-button">
<mwc-icon>groups</mwc-icon>
${translate("sidemenu.groupmanagement")}
</button>
</a>
${this.groupInvites.length > 0 ? (
html`
<div class="groups-button-notif">
${this.groupInvites.length}
</div>
<div class="groups-button-notif-number">
${this.groupInvites.length} ${translate("chatpage.cchange60")}
</div>
`
) : null}
</div>
<mwc-button
raised
label="${translate("chatpage.cchange3")}"
icon="person_off"
@click=${() => this.shadowRoot.querySelector('#blockedUserDialog').show()}>
</mwc-button>
</div>
</div>
<div class="chat">
@ -341,11 +364,12 @@ class Chat extends LitElement {
`
}
firstUpdated() {
this.changeLanguage()
this.changeTheme()
this.getChatBlockedList()
this.getLocalBlockedList()
async firstUpdated() {
this.changeLanguage();
this.changeTheme();
this.getChatBlockedList();
this.getLocalBlockedList();
await this.getPendingGroupInvites();
const getBlockedUsers = async () => {
let blockedUsers = await parentEpml.request('apiCall', {
@ -738,6 +762,20 @@ class Chat extends LitElement {
})
}
async getPendingGroupInvites() {
const myAddress = window.parent.reduxStore.getState().app.selectedAddress.address
try {
let pendingGroupInvites = await parentEpml.request('apiCall', {
url: `/groups/invites/${myAddress}`
})
this.groupInvites = pendingGroupInvites;
} catch (error) {
console.error(error);
let err4string = get("chatpage.cchange61");
parentEpml.request('showSnackBar', `${err4string}`)
}
}
async unblockUser(websiteObj) {
let owner = websiteObj.owner