fix(act-center): multiple fixes to the activity center

This commit is contained in:
Jonathan Rainville 2021-07-27 12:59:38 -04:00 committed by Iuri Matias
parent d7c368bcb6
commit e2d91dc66b
4 changed files with 16 additions and 3 deletions

View File

@ -243,6 +243,12 @@ QtObject:
self.setNewData(activityCenterNotifications)
else:
for activityCenterNotification in activityCenterNotifications:
var found = false
for notif in self.activityCenterNotifications:
if activityCenterNotification.id == notif.id:
found = true
break
if found: continue
self.addActivityNotificationItemToList(activityCenterNotification, false)
self.nbUnreadNotifications = self.status.chat.unreadActivityCenterNotificationsCount()

View File

@ -234,7 +234,7 @@ Item {
membersButton.visible: appSettings.showOnlineUsers && chatsModel.channelView.activeChannel.chatType !== Constants.chatTypeOneToOne
notificationButton.visible: appSettings.isActivityCenterEnabled
notificationCount: chatsModel.activityNotificationList.unreadCount
notificationCount: chatsModel.activityNotificationList.unreadCount + profileModel.contacts.contactRequests.count
onSearchButtonClicked: searchPopup.open()
SearchPopup {

View File

@ -20,7 +20,9 @@ Item {
(model.notificationType === Constants.activityCenterNotificationTypeReply && activityCenter.currentFilter === ActivityCenter.Filter.Replies)
}
width: parent.width
height: visible ? messageNotificationContent.height : 0
// Setting a height of 0 breaks the layout for when it comes back visible
// The Item never goes back to actually have a height or width
height: visible ? messageNotificationContent.height : 0.01
function openProfile() {
const pk = model.author
@ -58,8 +60,13 @@ Item {
AcceptRejectOptionsButtons {
id: buttons
onAcceptClicked: {
const setActiveChannel = chatsModel.channelView.setActiveChannel
const chatId = model.message.chatId
const messageId = model.message.messageId
profileModel.contacts.addContact(model.author)
chatsModel.activityNotificationList.acceptActivityCenterNotification(model.id)
setActiveChannel(chatId)
positionAtMessage(messageId)
}
onDeclineClicked: chatsModel.activityNotificationList.dismissActivityCenterNotification(model.id)
onProfileClicked: root.openProfile()

View File

@ -50,7 +50,7 @@ Rectangle {
id: replyComponent
Item {
property int replyMessageIndex: chatsModel.getMessageIndex(chatId, responseTo)
property int replyMessageIndex: chatsModel.messageView.getMessageIndex(chatId, responseTo)
property string repliedMessageContent: replyMessageIndex > -1 ? chatsModel.messageView.getMessageData(chatId, replyMessageIndex, "message") : "";