diff --git a/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m b/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m index 16c698c195..908a13827a 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m @@ -1105,7 +1105,18 @@ const CGFloat kMaxTextViewHeight = 98; - (void)stickerButtonPressed { OWSLogVerbose(@""); - + + __block BOOL hasInstalledStickerPacks; + [self.databaseStorage readWithBlock:^(SDSAnyReadTransaction *transaction) { + hasInstalledStickerPacks = [StickerManager installedStickerPacksWithTransaction:transaction].count > 0; + }]; + if (!hasInstalledStickerPacks) { + // If the keyboard is presented and no stickers are installed, + // show the manage stickers view. Do not show the sticker keyboard. + [self presentManageStickersView]; + return; + } + [self activateStickerKeyboard]; } diff --git a/SignalMessaging/ViewControllers/Stickers/StickerKeyboard.swift b/SignalMessaging/ViewControllers/Stickers/StickerKeyboard.swift index c3fc074eb1..c93f7638fe 100644 --- a/SignalMessaging/ViewControllers/Stickers/StickerKeyboard.swift +++ b/SignalMessaging/ViewControllers/Stickers/StickerKeyboard.swift @@ -102,17 +102,6 @@ public class StickerKeyboard: UIStackView { } @objc public func wasPresented() { - // If there are no recents, default to showing the first sticker pack. - if currentPageCollectionView.stickerCount < 1 { - selectedStickerPack = stickerPacks.first - - if selectedStickerPack == nil { - // If the keyboard is presented and no stickers are - // installed, show the manage stickers view. - delegate?.presentManageStickersView() - } - } - updatePageConstraints() } @@ -247,7 +236,7 @@ public class StickerKeyboard: UIStackView { private var stickerPackCollectionViews = [ StickerPackCollectionView(), StickerPackCollectionView(), - StickerPackCollectionView(), + StickerPackCollectionView() ] private var stickerPackCollectionViewConstraints = [NSLayoutConstraint]()