UI improvements and bug fixes

This commit is contained in:
sairaj mote 2022-09-07 17:39:24 +05:30
parent 161e24b4e7
commit 6868c4d900
4 changed files with 24 additions and 16 deletions

View File

@ -1803,19 +1803,19 @@ sm-button[variant=primary] {
@-webkit-keyframes pop { @-webkit-keyframes pop {
0% { 0% {
transform: rotate(5deg) translate(-0.5rem, 1rem); transform: translate(-0.5rem, 1rem);
} }
100% { 100% {
transform: rotate(0) translate(0, 0); transform: translate(0, 0);
} }
} }
@keyframes pop { @keyframes pop {
0% { 0% {
transform: rotate(5deg) translate(-0.5rem, 1rem); transform: translate(-0.5rem, 1rem);
} }
100% { 100% {
transform: rotate(0) translate(0, 0); transform: translate(0, 0);
} }
} }
.back-button { .back-button {

2
css/main.min.css vendored

File diff suppressed because one or more lines are too long

View File

@ -1884,11 +1884,11 @@ sm-button[variant="primary"] {
@keyframes pop { @keyframes pop {
0% { 0% {
transform: rotate(5deg) translate(-0.5rem, 1rem); transform: translate(-0.5rem, 1rem);
} }
100% { 100% {
transform: rotate(0) translate(0, 0); transform: translate(0, 0);
} }
} }

View File

@ -106,9 +106,6 @@
</header> </header>
<div id="landing" class="grid inner-page hidden"> <div id="landing" class="grid inner-page hidden">
<div class="left"> <div class="left">
<h4>
FLO Messenger
</h4>
<h1 class="title-font"> <h1 class="title-font">
Truly Secure, Private and Reliable. Truly Secure, Private and Reliable.
</h1> </h1>
@ -2774,13 +2771,27 @@
function updateMessageUI(messagesData, sentByMe = false) { function updateMessageUI(messagesData, sentByMe = false) {
for (let messageId in messagesData) { for (let messageId in messagesData) {
console.log(messagesData[messageId]) console.log(messagesData[messageId])
const { category, floID, time, message, sender, groupID, admin, name, pipeID } = messagesData[messageId] const { category, floID, time, message, sender, groupID, admin, name, pipeID, unconfirmed } = messagesData[messageId]
// code to run if a chat is opened // code to run if a chat is opened
if (activeChat && activeChat.floID === (floID || groupID || pipeID)) { if (activeChat && activeChat.floID === (floID || groupID || pipeID)) {
if (!sentByMe && sender && sender === floDapps.user.id) { if (!sentByMe && sender && sender === floDapps.user.id) {
// if message is sent by me, then dont add it to the chat // if message is sent by me, then dont add it to the chat
} else { } else {
getRef('messages_container').append(render.messageBubble(messagesData[messageId])) const messageBody = render.messageBubble(messagesData[messageId]);
getRef('messages_container').append(messageBody)
if (unconfirmed) {
const messageHeight = getRef('messages_container').lastElementChild.clientHeight;
getRef('messages_container').animate([
{ transform: `translateY(${messageHeight}px)` },
{ transform: `none` },
], {
duration: 300,
easing: 'ease',
fill: 'forwards'
}).onfinish = e => {
e.target.cancel()
}
}
} }
if (chatScrollInfo['isScrolledUp']) { if (chatScrollInfo['isScrolledUp']) {
@ -2788,9 +2799,8 @@
scrollToBottom() scrollToBottom()
} }
// remove encryption badge if it exists // remove encryption badge if it exists
if (!groupID && floGlobals.notEncrypted[activeChat.floID] && floID !== floDapps.user.id) { if (!groupID && floGlobals.pubKeys[activeChat.floID] && floID !== floDapps.user.id) {
getRef('warn_no_encryption').remove() getRef('warn_no_encryption').remove()
delete floGlobals.notEncrypted[activeChat.floID]
} }
} }
let chatCard = getChatCard(floID || groupID || pipeID) let chatCard = getChatCard(floID || groupID || pipeID)
@ -3568,7 +3578,6 @@
} }
floGlobals.typedMessages = {} floGlobals.typedMessages = {}
floGlobals.notEncrypted = {}
floGlobals.pipeSigns = {} floGlobals.pipeSigns = {}
function viewConversation(floID) { function viewConversation(floID) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
@ -3614,7 +3623,6 @@
if (activeChat.type === 'plain') { if (activeChat.type === 'plain') {
if (!floGlobals.pubKeys[floID]) { if (!floGlobals.pubKeys[floID]) {
getRef('messages_container').prepend(html.node`<strong id="warn_no_encryption" class="event-card">Converstion is not encrypted until receiver replies</strong>`) getRef('messages_container').prepend(html.node`<strong id="warn_no_encryption" class="event-card">Converstion is not encrypted until receiver replies</strong>`)
floGlobals.notEncrypted[floID] = true
} }
} else if (activeChat.type === 'pipeline') { } else if (activeChat.type === 'pipeline') {
if (!messenger.pipeline[floID].disabled && !floGlobals.pipeSigns[floID].has(floDapps.user.id)) { if (!messenger.pipeline[floID].disabled && !floGlobals.pipeSigns[floID].has(floDapps.user.id)) {