mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-22 01:22:46 +02:00
MESSENGER-2762 Initial Merge
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
Copyright 2019 New Vector Ltd
|
||||
Copyright (c) 2021 BWI GmbH
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -64,9 +65,12 @@ import Foundation
|
||||
// MARK: - Private
|
||||
|
||||
private func loadData() {
|
||||
let history = RecentReactionHistoryDefaultService()
|
||||
let filteredReactions = history.reactions(defaultReactions: self.reactions)
|
||||
|
||||
let reactionCounts = self.aggregatedReactions?.withNonZeroCount()?.reactions ?? []
|
||||
|
||||
var quickReactionsWithUserReactedFlag: [String: Bool] = Dictionary(uniqueKeysWithValues: self.reactions.map { ($0, false) })
|
||||
var quickReactionsWithUserReactedFlag: [String: Bool] = Dictionary(uniqueKeysWithValues: filteredReactions.map { ($0, false) })
|
||||
|
||||
reactionCounts.forEach { (reactionCount) in
|
||||
if let hasUserReacted = quickReactionsWithUserReactedFlag[reactionCount.reaction], hasUserReacted == false {
|
||||
@@ -74,7 +78,7 @@ import Foundation
|
||||
}
|
||||
}
|
||||
|
||||
let reactionMenuItemViewDatas: [ReactionMenuItemViewData] = self.reactions.map { reaction -> ReactionMenuItemViewData in
|
||||
let reactionMenuItemViewDatas: [ReactionMenuItemViewData] = filteredReactions.map { reaction -> ReactionMenuItemViewData in
|
||||
let isSelected = quickReactionsWithUserReactedFlag[reaction] ?? false
|
||||
return ReactionMenuItemViewData(emoji: reaction, isSelected: isSelected)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user