Bug fixes

This commit is contained in:
sairaj mote 2023-04-06 00:02:33 +05:30
parent 5469fd817b
commit 9de4585c9b

View File

@ -2727,9 +2727,14 @@
</div>` </div>`
break; break;
case 'BROADCAST': case 'BROADCAST':
// render appropriate UI when transaction is broadcasted
if ($('#transaction_details')) if ($('#transaction_details'))
$('#transaction_details').remove() $('#transaction_details').remove()
// disable chatting
getRef('chat_footer').classList.add('hidden') getRef('chat_footer').classList.add('hidden')
const chatCard = getChatCard(activeChat.address)
if (chatCard)
chatCard.querySelector('.tag').textContent += ' - Completed'
let redirectTo = `https://live.blockcypher.com/btc/tx/` let redirectTo = `https://live.blockcypher.com/btc/tx/`
if (messenger.pipeline[activeChat.address].model === 'flo_multisig') if (messenger.pipeline[activeChat.address].model === 'flo_multisig')
redirectTo = `https://flosight.ranchimall.net/tx/` redirectTo = `https://flosight.ranchimall.net/tx/`
@ -3047,7 +3052,6 @@
document.title = `New mail(s)` document.title = `New mail(s)`
addNotificationBadge('#mail_page_button', Object.keys(data.mails).length) addNotificationBadge('#mail_page_button', Object.keys(data.mails).length)
} }
// console.log(data.requests, data.responses)
messenger.list_request_received({ completed: false }).then(requests => addNotificationBadge('#notification_panel_button', Object.keys(requests).length, { replace: true })) messenger.list_request_received({ completed: false }).then(requests => addNotificationBadge('#notification_panel_button', Object.keys(requests).length, { replace: true }))
updateMessageUI(data.messages) updateMessageUI(data.messages)
renderMailList(data.mails, true) renderMailList(data.mails, true)
@ -3123,16 +3127,15 @@
easing: 'ease', easing: 'ease',
fill: 'forwards' fill: 'forwards'
} }
console.log('updateMessageUI', messagesData)
for (let messageId in messagesData) { for (let messageId in messagesData) {
const { category, floID, time, message, sender, groupID, admin, name, pipeID, unconfirmed, type } = messagesData[messageId] const { category, floID, time, message, sender, groupID, admin, name, pipeID, unconfirmed, type } = messagesData[messageId]
const chatAddress = floID || groupID || pipeID const chatAddress = floID || groupID || pipeID
// code to run if a chat is opened // code to run if a chat is opened
if (activeChat && floCrypto.isSameAddr(activeChat.address, chatAddress)) { if (activeChat && floCrypto.isSameAddr(activeChat.address, chatAddress)) {
if (!sentByMe && (type && type !== 'TRANSACTION') && sender && floCrypto.isSameAddr(sender, floDapps.user.id)) { if (sentByMe || type === 'TRANSACTION' || !sender || !floCrypto.isSameAddr(sender, floDapps.user.id)) {
// if message is sent by me, then dont add it to the chat
} else {
const messageBody = render.messageBubble(messagesData[messageId]); const messageBody = render.messageBubble(messagesData[messageId]);
getRef('messages_container').append(messageBody) getRef('messages_container').append(messageBody);
} }
if (!chatScrollInfo['isScrolledUp']) { if (!chatScrollInfo['isScrolledUp']) {
scrollToBottom() scrollToBottom()
@ -4066,7 +4069,6 @@
lastSender = '' lastSender = ''
// fix issue with encryption // fix issue with encryption
renderMessages(floID).then(async () => { renderMessages(floID).then(async () => {
console.log('rendered messages', activeChat)
if (activeChat.type === 'pipeline') { if (activeChat.type === 'pipeline') {
if (!messenger.pipeline[floID].disabled && floGlobals.pipeSigns[floID] && !floGlobals.pipeSigns[floID].has(floDapps.user.id)) { if (!messenger.pipeline[floID].disabled && floGlobals.pipeSigns[floID] && !floGlobals.pipeSigns[floID].has(floDapps.user.id)) {
getRef('messages_container').append(html.node` getRef('messages_container').append(html.node`