Skip to content

Commit

Permalink
Fixed issue where group messages got marked as unread
Browse files Browse the repository at this point in the history
  • Loading branch information
f-r00t committed Mar 2, 2024
1 parent fc0be97 commit b3ea7d9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Database.js
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ export async function deleteKnownTransaction(txhash) {

export async function saveGroupMessage(group, type, message, timestamp, nickname, address, reply, hash) {

const read = (address == Globals.wallet.getPrimaryAddress() ? 1 : 0);
const read = (address == Globals?.wallet.getPrimaryAddress() || Globals?.activeGroup == group ? 1 : 0);

console.log('Saving group message', group, type, message, timestamp, nickname, address, read);

Expand Down
2 changes: 1 addition & 1 deletion src/Globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class globals {

this.activeChat = '';

this.activeBoard = '';
this.activeGroup = '';

this.language = 'en-US';

Expand Down
4 changes: 2 additions & 2 deletions src/Groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -833,13 +833,13 @@ export class GroupChatScreenNoTranslation extends React.Component {
messages: messages
});

Globals.activeChat = this.state.key;
Globals.activeGroup = this.state.key;

}

async componentWillUnmount() {

Globals.activeChat = '';
Globals.activeGroup = '';
Globals.updateGroupsFunctions.pop();

}
Expand Down
2 changes: 1 addition & 1 deletion src/HuginUtilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ async function getGroupMessage(tx) {

const groupname = await getGroupName(key);

if (Globals.activeChat != key && !from_myself) {
if (Globals.activeGroup != key && !from_myself) {

Globals.notificationQueue.push({
title: `${nickname} in ${groupname}`,//'Incoming transaction received!',
Expand Down

0 comments on commit b3ea7d9

Please sign in to comment.