Skip to content
This repository has been archived by the owner on Dec 16, 2021. It is now read-only.

Commit

Permalink
The overall nbumber of unread private chats are now updated insantly …
Browse files Browse the repository at this point in the history
…when loading a private chat
  • Loading branch information
Bios-Marcel committed Aug 30, 2020
1 parent a4aa027 commit 93b7a99
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ui/privatechats.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"github.com/Bios-Marcel/cordless/readstate"
"github.com/Bios-Marcel/cordless/ui/tviewutil"

"github.com/Bios-Marcel/discordgo"
"github.com/Bios-Marcel/cordless/tview"
"github.com/Bios-Marcel/discordgo"

"github.com/Bios-Marcel/cordless/config"
)
Expand Down Expand Up @@ -305,7 +305,6 @@ func (privateList *PrivateChatList) MarkChannelAsLoaded(channel *discordgo.Chann
for node, state := range privateList.privateChannelStates {
if state == loaded {
privateList.privateChannelStates[node] = read
privateList.setNotificationCount(privateList.amountOfUnreadChannels())
if vtxxx {
node.SetAttributes(tcell.AttrNone)
} else {
Expand All @@ -327,6 +326,8 @@ func (privateList *PrivateChatList) MarkChannelAsLoaded(channel *discordgo.Chann
break
}
}

privateList.setNotificationCount(privateList.amountOfUnreadChannels())
}

// SetOnFriendSelect sets the handler that decides what happens when a friend
Expand Down

0 comments on commit 93b7a99

Please sign in to comment.