fix minor issues

pull/560/head
Ryan Zhao 3 years ago
parent fb99bc6abd
commit 29cd6fb312

@ -167,7 +167,7 @@ final class IncomingCallBanner: UIView, UIGestureRecognizerDelegate {
self.alpha = 0.0
let window = CurrentAppContext().mainWindow!
window.addSubview(self)
let topMargin = UIApplication.shared.keyWindow!.safeAreaInsets.top - Values.smallSpacing
let topMargin = window.safeAreaInsets.top - Values.smallSpacing
self.autoPinWidthToSuperview(withMargin: Values.smallSpacing)
self.autoPinEdge(toSuperviewEdge: .top, withInset: topMargin)
UIView.animate(withDuration: 0.5, delay: 0, options: [], animations: {

@ -207,8 +207,7 @@ final class VisibleMessageCell : MessageCell, LinkPreviewViewDelegate {
// MARK: Updating
override func update() {
guard let viewItem = viewItem, let message = viewItem.interaction as? TSMessage else { return }
let thread = message.thread
let isGroupThread = thread.isGroupThread()
let isGroupThread = viewItem.isGroupThread
// Profile picture view
profilePictureViewLeftConstraint.constant = isGroupThread ? VisibleMessageCell.groupThreadHSpacing : 0
profilePictureViewWidthConstraint.constant = isGroupThread ? VisibleMessageCell.profilePictureSize : 0
@ -217,8 +216,8 @@ final class VisibleMessageCell : MessageCell, LinkPreviewViewDelegate {
if let senderSessionID = senderSessionID {
profilePictureView.update(for: senderSessionID)
}
if let thread = thread as? TSGroupThread, thread.isOpenGroup, let senderSessionID = senderSessionID {
if let openGroupV2 = Storage.shared.getV2OpenGroup(for: thread.uniqueId!) {
if let senderSessionID = senderSessionID, message.isOpenGroupMessage {
if let openGroupV2 = Storage.shared.getV2OpenGroup(for: message.uniqueThreadId) {
let isUserModerator = OpenGroupAPIV2.isUserModerator(senderSessionID, for: openGroupV2.room, on: openGroupV2.server)
moderatorIconImageView.isHidden = !isUserModerator || profilePictureView.isHidden
} else {

@ -143,7 +143,7 @@ final class JoinOpenGroupVC : BaseVC, UIPageViewControllerDataSource, UIPageView
Storage.shared.write { transaction in
OpenGroupManagerV2.shared.add(room: room, server: server, publicKey: publicKey, using: transaction)
.done(on: DispatchQueue.main) { [weak self] _ in
self?.presentingViewController!.dismiss(animated: true, completion: nil)
self?.presentingViewController?.dismiss(animated: true, completion: nil)
let appDelegate = UIApplication.shared.delegate as! AppDelegate
appDelegate.forceSyncConfigurationNowIfNeeded().retainUntilComplete() // FIXME: It's probably cleaner to do this inside addOpenGroup(...)
}

Loading…
Cancel
Save