From ac121696278b59959564bc2041bde956e6e9c67b Mon Sep 17 00:00:00 2001
From: Michael Kirk <michael@signal.org>
Date: Mon, 8 Oct 2018 07:08:35 -0600
Subject: [PATCH] Keep home view controller in the navigation stack when
 entering an archived conversation.

---
 Signal/src/ViewControllers/HomeView/HomeViewController.m | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/Signal/src/ViewControllers/HomeView/HomeViewController.m b/Signal/src/ViewControllers/HomeView/HomeViewController.m
index afb394f81..cc0ca55d1 100644
--- a/Signal/src/ViewControllers/HomeView/HomeViewController.m
+++ b/Signal/src/ViewControllers/HomeView/HomeViewController.m
@@ -1207,13 +1207,16 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
         return;
     }
 
-    // We do this synchronously if we're already on the main thread.
     DispatchMainThreadSafe(^{
         ConversationViewController *conversationVC = [ConversationViewController new];
         [conversationVC configureForThread:thread action:action focusMessageId:focusMessageId];
         self.lastThread = thread;
 
-        [self.navigationController setViewControllers:@[ self, conversationVC ] animated:isAnimated];
+        if (self.homeViewMode == HomeViewMode_Archive) {
+            [self.navigationController pushViewController:conversationVC animated:isAnimated];
+        } else {
+            [self.navigationController setViewControllers:@[ self, conversationVC ] animated:isAnimated];
+        }
     });
 }