bug fixes

This commit is contained in:
sairaj mote 2022-06-30 22:17:08 +05:30
parent 7abb09772c
commit f103ab16ce
4 changed files with 33 additions and 66 deletions

View File

@ -1360,9 +1360,6 @@ sm-button[variant=primary] {
font-weight: 400; font-weight: 400;
max-width: 90%; max-width: 90%;
} }
.mail .back {
margin-left: -0.5rem;
}
.mail .mail-subject, .mail .mail-subject,
.mail .mail-content { .mail .mail-content {
overflow-wrap: break-word; overflow-wrap: break-word;
@ -1985,20 +1982,6 @@ sm-button[variant=primary] {
width: 1em; width: 1em;
} }
.back {
padding: 0.7rem;
height: 2.4rem;
width: 2.4rem;
margin-left: -0.5rem;
cursor: pointer;
stroke-width: 8;
opacity: 0.8;
-webkit-tap-highlight-color: transparent;
}
.back:hover {
opacity: 1;
}
#settings #settings_sidebar header { #settings #settings_sidebar header {
padding: 1rem 1.5rem; padding: 1rem 1.5rem;
} }

2
css/main.min.css vendored

File diff suppressed because one or more lines are too long

View File

@ -1204,9 +1204,6 @@ sm-button[variant="primary"] {
font-weight: 400; font-weight: 400;
max-width: 90%; max-width: 90%;
} }
.back {
margin-left: -0.5rem;
}
.mail-subject, .mail-subject,
.mail-content { .mail-content {
overflow-wrap: break-word; overflow-wrap: break-word;
@ -1770,19 +1767,6 @@ sm-button[variant="primary"] {
width: 1em; width: 1em;
} }
} }
.back {
padding: 0.7rem;
height: 2.4rem;
width: 2.4rem;
margin-left: -0.5rem;
cursor: pointer;
stroke-width: 8;
opacity: 0.8;
-webkit-tap-highlight-color: transparent;
&:hover {
opacity: 1;
}
}
#settings { #settings {
#settings_sidebar header { #settings_sidebar header {
padding: 1rem 1.5rem; padding: 1rem 1.5rem;

View File

@ -1409,7 +1409,8 @@
async function showPage(targetPage, options = {}) { async function showPage(targetPage, options = {}) {
const { firstLoad, hashChange } = options const { firstLoad, hashChange } = options
let pageId let pageId
let subPageId let subPageId1
let subPageId2
let params = {} let params = {}
let searchParams let searchParams
if (targetPage === '') { if (targetPage === '') {
@ -1425,11 +1426,13 @@
searchParams = splitAddress.pop() searchParams = splitAddress.pop()
const pages = splitAddress.pop().split('/') const pages = splitAddress.pop().split('/')
pageId = pages[1] pageId = pages[1]
subPageId = pages[2] subPageId1 = pages[2]
subPageId2 = pages[3]
} else { } else {
const pages = targetPage.split('/') const pages = targetPage.split('/')
pageId = pages[1] pageId = pages[1]
subPageId = pages[2] subPageId1 = pages[2]
subPageId2 = pages[3]
} }
} else { } else {
pageId = targetPage pageId = targetPage
@ -1458,7 +1461,7 @@
targetPage = 'sign_up' targetPage = 'sign_up'
break; break;
case 'chat_page': case 'chat_page':
if (subPageId && activeChat.floID) { if (subPageId1 && activeChat.floID) {
getRef('chat_view').classList.remove('hide') getRef('chat_view').classList.remove('hide')
getRef('chat_view').classList.remove('hide-on-mobile') getRef('chat_view').classList.remove('hide-on-mobile')
getRef('contacts').classList.add('hide-on-mobile') getRef('contacts').classList.add('hide-on-mobile')
@ -1473,9 +1476,9 @@
removeNotificationBadge('chat_page_button') removeNotificationBadge('chat_page_button')
break; break;
case 'mail_page': case 'mail_page':
if (subPageId) { if (subPageId1) {
let childIndex let childIndex
switch (subPageId) { switch (subPageId1) {
case 'inbox': case 'inbox':
childIndex = 0 childIndex = 0
break; break;
@ -1484,13 +1487,25 @@
break; break;
} }
showChildElement('mail_sections', childIndex) showChildElement('mail_sections', childIndex)
getRef("mail_type_selector").value = subPageId getRef("mail_type_selector").value = subPageId1
if (subPageId2 && activeMail) {
getRef('mail').classList.remove('hide')
getRef('mail').classList.remove('hide-on-mobile')
getRef('mails').classList.add('hide-on-mobile')
getRef('main_navbar').classList.add('hide-on-mobile')
} else {
history.replaceState(null, null, `#/mail_page/${subPageId1}`);
getRef('mail').classList.add('hide-on-mobile')
getRef('mails').classList.remove('hide-on-mobile')
activeMail = ''
getRef('main_navbar').classList.remove('hide-on-mobile')
}
} }
removeNotificationBadge('mail_page_button') removeNotificationBadge('mail_page_button')
break; break;
case 'settings': case 'settings':
if (subPageId) { if (subPageId1) {
showPanel(subPageId) showPanel(subPageId1)
} else { } else {
hidePanel() hidePanel()
} }
@ -1936,8 +1951,7 @@
</script> </script>
<script> <script>
let activeMailPage = getRef('mails'), let activeChat = {},
activeChat = {},
activeMail, activeMail,
frag = document.createDocumentFragment() frag = document.createDocumentFragment()
@ -1986,17 +2000,18 @@
senderName = getContactName(from); senderName = getContactName(from);
floID = from floID = from
} }
const backURL = `#/mail_page/${getRef('mail_type_selector').value}`
return html.node` return html.node`
<div class="mail"> <div class="mail">
<header class="mail-header flex flex-direction-column"> <header class="mail-header flex flex-direction-column">
<div class="flex space-between align-center"> <div class="flex space-between align-center">
<div class="flex align-center"> <div class="flex align-center">
<button onclick="goto('mails')" class="back hide-on-desktop"> <a href="${backURL}" class="button icon-only back-button hide-on-desktop">
<svg class="icon margin-right-0-5" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"> <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> <path d="M0 0h24v24H0V0z" fill="none"></path>
<path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"></path> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"></path>
</svg> </svg>
</button> </a>
<div class="initial flex align-center" style=${`--contact-color: var(${contactColor(floID)})`}>${senderName.charAt(0)}</div> <div class="initial flex align-center" style=${`--contact-color: var(${contactColor(floID)})`}>${senderName.charAt(0)}</div>
</div> </div>
<time class="date justify-right">${getFormattedTime(timestamp)}</time> <time class="date justify-right">${getFormattedTime(timestamp)}</time>
@ -2756,20 +2771,12 @@
if (this.checked) { if (this.checked) {
isEnterSend = true isEnterSend = true
localStorage.setItem("isEnterSend", 'true'); localStorage.setItem("isEnterSend", 'true');
} } else {
else {
isEnterSend = false isEnterSend = false
localStorage.setItem("isEnterSend", 'false'); localStorage.setItem("isEnterSend", 'false');
} }
}) })
function goto(page) {
getRef('mail').classList.add('hide-on-mobile')
getRef('mails').classList.remove('hide-on-mobile')
activeMailPage = getRef('mails')
getRef('main_navbar').classList.remove('hide-on-mobile')
}
getRef("mail_type_selector").addEventListener('change', function (e) { getRef("mail_type_selector").addEventListener('change', function (e) {
location.hash = `#/mail_page/${e.target.value}` location.hash = `#/mail_page/${e.target.value}`
}) })
@ -2781,12 +2788,6 @@
activeMail.classList.remove('active') activeMail.classList.remove('active')
e.target.closest(".mail-card").classList.add('active') e.target.closest(".mail-card").classList.add('active')
activeMail = e.target.closest(".mail-card") activeMail = e.target.closest(".mail-card")
if (activeMailPage.id === 'mails') {
getRef('mail').classList.remove('hide-on-mobile')
getRef('mails').classList.add('hide-on-mobile')
activeMailPage = getRef('mail')
getRef('main_navbar').classList.add('hide-on-mobile')
}
} }
}) })
@ -2808,8 +2809,7 @@
if (e.code === "Enter" && e.shiftKey) { if (e.code === "Enter" && e.shiftKey) {
e.preventDefault() e.preventDefault()
getRef('type_message').value += '\r\n'; getRef('type_message').value += '\r\n';
} } else if (!e.shiftKey && e.code === "Enter" && isEnterSend) {
else if (!e.shiftKey && e.code === "Enter" && isEnterSend) {
e.preventDefault() e.preventDefault()
sendMessage() sendMessage()
} }
@ -3066,7 +3066,7 @@
getRef("show_reply_popup").classList.remove("hide"); getRef("show_reply_popup").classList.remove("hide");
} }
messenger.removeMark(mailRef, "unread"); messenger.removeMark(mailRef, "unread");
getRef('mail').classList.remove('hide') location.hash = `#/mail_page/${getRef("mail_type_selector").value}/mail`
}).catch(error => notify("Unable to read mail", "error", error)) }).catch(error => notify("Unable to read mail", "error", error))
} }