bug fixes
This commit is contained in:
parent
42b5c8c652
commit
16d93a03c2
10
css/main.css
10
css/main.css
@ -1082,7 +1082,7 @@ sm-button[variant=primary] {
|
||||
}
|
||||
|
||||
#contact_name {
|
||||
margin: 0.6rem 1.5rem;
|
||||
margin: 0.5rem 0;
|
||||
}
|
||||
#contact_name::part(text) {
|
||||
font-size: 1.2rem;
|
||||
@ -1707,10 +1707,9 @@ sm-button[variant=primary] {
|
||||
}
|
||||
}
|
||||
#chat_header {
|
||||
padding: 0 1rem;
|
||||
min-height: 4rem;
|
||||
grid-template-columns: 1fr auto;
|
||||
padding: 0.5rem 1rem;
|
||||
align-content: center;
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
#chat_header .flex {
|
||||
height: 100%;
|
||||
@ -2123,9 +2122,10 @@ sm-button[variant=primary] {
|
||||
}
|
||||
|
||||
#chat_header {
|
||||
grid-template-columns: auto 1fr;
|
||||
grid-template-columns: auto minmax(0, 1fr);
|
||||
}
|
||||
#chat_header #chat_details {
|
||||
width: calc(100% - 2rem);
|
||||
margin-left: -1.7rem;
|
||||
}
|
||||
|
||||
|
||||
2
css/main.min.css
vendored
2
css/main.min.css
vendored
File diff suppressed because one or more lines are too long
@ -968,7 +968,7 @@ sm-button[variant="primary"] {
|
||||
background-color: var(--contact-color, --accent-color);
|
||||
}
|
||||
#contact_name {
|
||||
margin: 0.6rem 1.5rem;
|
||||
margin: 0.5rem 0;
|
||||
&::part(text) {
|
||||
font-size: 1.2rem;
|
||||
font-weight: 500;
|
||||
@ -1521,10 +1521,9 @@ sm-button[variant="primary"] {
|
||||
}
|
||||
}
|
||||
#chat_header {
|
||||
padding: 0 1rem;
|
||||
min-height: 4rem;
|
||||
grid-template-columns: 1fr auto;
|
||||
padding: 0.5rem 1rem;
|
||||
align-content: center;
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
.flex {
|
||||
height: 100%;
|
||||
}
|
||||
@ -1916,8 +1915,9 @@ sm-button[variant="primary"] {
|
||||
}
|
||||
}
|
||||
#chat_header {
|
||||
grid-template-columns: auto 1fr;
|
||||
grid-template-columns: auto minmax(0, 1fr);
|
||||
#chat_details {
|
||||
width: calc(100% - 2rem);
|
||||
margin-left: -1.7rem;
|
||||
}
|
||||
}
|
||||
|
||||
34
index.html
34
index.html
@ -990,7 +990,7 @@
|
||||
<svg class="icon" xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"> <g> <rect fill="none" height="24" width="24" /> <path d="M12,18l-6,0l-4,4V4c0-1.1,0.9-2,2-2h16c1.1,0,2,0.9,2,2v7l-2,0V4H4v12l8,0V18z M23,14.34l-1.41-1.41l-4.24,4.24l-2.12-2.12 l-1.41,1.41L17.34,20L23,14.34z" /> </g> </svg>
|
||||
Mark as read
|
||||
</button>
|
||||
`
|
||||
`;
|
||||
} else {
|
||||
markReadUnread = html`
|
||||
<button id="mark_unread_option" class="option" onclick="markAsUnread()">
|
||||
@ -999,6 +999,23 @@
|
||||
</button>
|
||||
`;
|
||||
}
|
||||
let blockUnblock
|
||||
if (messenger.blocked.has(clickedContact.floID)) {
|
||||
blockUnblock = html`
|
||||
<button class="option" onclick="unblockUser()">
|
||||
<svg class="icon" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M7 11v2h10v-2H7zm5-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/></svg>
|
||||
Unblock
|
||||
</button>
|
||||
`;
|
||||
} else {
|
||||
blockUnblock = html`
|
||||
<button class="option option--danger" onclick="blockUser()">
|
||||
<svg class="icon" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zM4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12zm8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8z"/></svg>
|
||||
Block
|
||||
</button>
|
||||
`;
|
||||
}
|
||||
|
||||
let deleteChat
|
||||
if (!clickedContact.isGroup) {
|
||||
deleteChat = html`
|
||||
@ -1011,10 +1028,7 @@
|
||||
renderElem(getRef('contact_options'), html`
|
||||
${addAsContact}
|
||||
${markReadUnread}
|
||||
<button class="option option--danger" onclick="blockUser()">
|
||||
<svg class="icon" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zM4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12zm8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8z"/></svg>
|
||||
Block
|
||||
</button>
|
||||
${blockUnblock}
|
||||
<button class="option option--danger" onclick="clearChat()">
|
||||
<svg class="icon" xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"> <g> <rect fill="none" height="24" width="24" /> </g> <g> <g> <path d="M16,11h-1V3c0-1.1-0.9-2-2-2h-2C9.9,1,9,1.9,9,3v8H8c-2.76,0-5,2.24-5,5v7h18v-7C21,13.24,18.76,11,16,11z M11,3h2v8h-2V3 z M19,21h-2v-3c0-0.55-0.45-1-1-1s-1,0.45-1,1v3h-2v-3c0-0.55-0.45-1-1-1s-1,0.45-1,1v3H9v-3c0-0.55-0.45-1-1-1s-1,0.45-1,1v3H5 v-5c0-1.65,1.35-3,3-3h8c1.65,0,3,1.35,3,3V21z" /> </g> </g> </svg>
|
||||
Clear this chat
|
||||
@ -2834,7 +2848,6 @@
|
||||
getRef('contact_initial').textContent = name.charAt(0)
|
||||
if (activeChat.floID && activeChat.floID === clickedContact.floID) {
|
||||
getRef('receiver_initial').textContent = name.charAt(0)
|
||||
getRef('chat_dp').textContent = name.charAt(0)
|
||||
}
|
||||
}
|
||||
document.querySelectorAll(`.contact[data-flo-id="${floID}"]`).forEach(contact => {
|
||||
@ -2884,6 +2897,15 @@
|
||||
}
|
||||
})
|
||||
}
|
||||
function unblockUser() {
|
||||
getConfirmation('Unblock this FLO ID?', { message: `Are you sure to unblock this FLO ID?`, confirmText: 'Unblock', cancelText: 'Cancel' }).then(confirmed => {
|
||||
if (confirmed) {
|
||||
messenger.unblockUser(clickedContact.floID).then(result => {
|
||||
notify('FLo ID unblocked', 'success')
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
function clearChat() {
|
||||
getConfirmation('Clear chat?', { message: `Are you sure to clear this chat?`, confirmText: 'Clear', cancelText: 'Cancel' }).then(confirmed => {
|
||||
if (confirmed) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user