Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug #11

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ import UIKit
if let item = self.searchResults[safe: indexPath.row] {
item.selected = !item.selected
self.selectClosure?(item)
self.searchController.isActive = false
}
self.tableView.reloadData()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import UIKit
UIView(frame: CGRect(x: 16, y: self.navigation.frame.maxY+16, width: self.view.frame.width-32, height: 114)).backgroundColor(Theme.style == .dark ? UIColor.theme.neutralColor3:UIColor.theme.neutralColor95).cornerRadius(.extraSmall)
}()

public private(set) lazy var contentEditor: PlaceHolderTextView = {
PlaceHolderTextView(frame: CGRect(x: 16, y: self.container.frame.minY+13, width: self.view.frame.width-32, height: 114-38)).delegate(self).font(UIFont.theme.bodyLarge).backgroundColor(.clear)
public private(set) lazy var contentEditor: UITextView = {
UITextView(frame: CGRect(x: 16, y: self.container.frame.minY+13, width: self.view.frame.width-32, height: 114-38)).delegate(self).font(UIFont.theme.bodyLarge).backgroundColor(.clear)
}()

public private(set) lazy var limitCount: UILabel = {
Expand All @@ -47,10 +47,14 @@ import UIKit
open override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
self.contentEditor.bounces = false
self.contentEditor.showsVerticalScrollIndicator = false
self.contentEditor.showsHorizontalScrollIndicator = false

self.contentEditor.contentInset = UIEdgeInsets(top: -8, left: 10, bottom: 0, right: 10)
self.contentEditor.placeHolderColor = Theme.style == .dark ? UIColor.theme.neutralColor5:UIColor.theme.neutralColor6
// self.contentEditor.placeHolderColor = Theme.style == .dark ? UIColor.theme.neutralColor5:UIColor.theme.neutralColor6
let content = self.titleForHeader()
self.contentEditor.placeHolder = "Please input".chat.localize
// self.contentEditor.placeHolder = "Please input".chat.localize
self.navigation.title = content
self.contentEditor.text = self.raw
self.navigation.clickClosure = { [weak self] in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,17 @@ import UIKit
NotificationCenter.default.addObserver(self, selector: #selector(refreshList), name: Notification.Name(rawValue: "EaseChatUIKitContextUpdateCache"), object: nil)
}

open override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.refreshList()
}

@objc private func refreshList() {
for participant in participants {
if let remark = EaseChatUIKitContext.shared?.userCache?[participant.id] as? String {
participant.remark = remark
if let user = EaseChatUIKitContext.shared?.userCache?[participant.id]{
participant.nickname = user.nickname
participant.remark = user.remark
participant.avatarURL = user.avatarURL
}
}
self.participantsList.reloadData()
Expand Down Expand Up @@ -217,9 +224,11 @@ import UIKit
profile.id = id
if let user = EaseChatUIKitContext.shared?.userCache?[id] {
profile.nickname = user.nickname
profile.avatarURL = user.avatarURL
}
if let user = EaseChatUIKitContext.shared?.chatCache?[id] {
profile.nickname = user.nickname
profile.avatarURL = user.avatarURL
}

return profile
Expand All @@ -230,9 +239,11 @@ import UIKit
profile.id = self.chatGroup.owner
if let user = EaseChatUIKitContext.shared?.userCache?[self.chatGroup.owner] {
profile.nickname = user.nickname
profile.avatarURL = user.avatarURL
}
if let user = EaseChatUIKitContext.shared?.chatCache?[self.chatGroup.owner] {
profile.nickname = user.nickname
profile.avatarURL = user.avatarURL
}
self.participants.insert(profile, at: 0)
}
Expand All @@ -241,6 +252,14 @@ import UIKit
self.participants.append(contentsOf: list.map({
let profile = EaseProfile()
profile.id = $0 as String
if let user = EaseChatUIKitContext.shared?.userCache?[profile.id] {
profile.nickname = user.nickname
profile.avatarURL = user.avatarURL
}
if let user = EaseChatUIKitContext.shared?.chatCache?[profile.id] {
profile.nickname = user.nickname
profile.avatarURL = user.avatarURL
}
return profile
}))
}
Expand Down