Display threads notice if not displayed before

This commit is contained in:
ismailgulek
2022-03-18 13:23:26 +03:00
parent 653b26161e
commit 471250acb3
+35
View File
@@ -203,6 +203,7 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
@property (nonatomic, strong) CustomSizedPresentationController *customSizedPresentationController;
@property (nonatomic, strong) RoomParticipantsInviteCoordinatorBridgePresenter *participantsInvitePresenter;
@property (nonatomic, strong) ThreadsCoordinatorBridgePresenter *threadsBridgePresenter;
@property (nonatomic, strong) SlidingModalPresenter *threadsNoticeModalPresenter;
@property (nonatomic, getter=isActivitiesViewExpanded) BOOL activitiesViewExpanded;
@property (nonatomic, getter=isScrollToBottomHidden) BOOL scrollToBottomHidden;
@property (nonatomic, getter=isMissedDiscussionsBadgeHidden) BOOL missedDiscussionsBadgeHidden;
@@ -634,6 +635,11 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
}
self.showSettingsInitially = NO;
if (!RiotSettings.shared.threadsNoticeDisplayed)
{
[self showThreadsNotice];
}
}
- (void)viewDidDisappear:(BOOL)animated
@@ -6741,6 +6747,35 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
#pragma mark - Threads
- (void)showThreadsNotice
{
if (!self.threadsNoticeModalPresenter)
{
self.threadsNoticeModalPresenter = [SlidingModalPresenter new];
}
[self.threadsNoticeModalPresenter dismissWithAnimated:NO completion:nil];
ThreadsNoticeViewController *threadsNoticeVC = [ThreadsNoticeViewController instantiate];
MXWeakify(self);
threadsNoticeVC.didTapDoneButton = ^{
MXStrongifyAndReturnIfNil(self);
[self.threadsNoticeModalPresenter dismissWithAnimated:YES completion:^{
RiotSettings.shared.threadsNoticeDisplayed = YES;
}];
};
[self.threadsNoticeModalPresenter present:threadsNoticeVC
from:self.presentedViewController?:self
animated:YES
options:SlidingModalPresenter.SpanningOption
completion:nil];
}
- (void)openThreadWithId:(NSString *)threadId
{
if (self.threadsBridgePresenter)