From 634796e9dc7ba721426a245e3f3003d37b8b4710 Mon Sep 17 00:00:00 2001 From: Marcus Kida Date: Wed, 16 Nov 2022 13:43:54 +0100 Subject: [PATCH] fix: Only allow double-tap account toggle if more than 1 account exists --- Mastodon/Scene/Root/MainTab/MainTabBarController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mastodon/Scene/Root/MainTab/MainTabBarController.swift b/Mastodon/Scene/Root/MainTab/MainTabBarController.swift index 158cd769b..5f77d9584 100644 --- a/Mastodon/Scene/Root/MainTab/MainTabBarController.swift +++ b/Mastodon/Scene/Root/MainTab/MainTabBarController.swift @@ -407,7 +407,7 @@ extension MainTabBarController { assert(Thread.isMainThread) let request = MastodonAuthentication.sortedFetchRequest - guard let accounts = try? context.managedObjectContext.fetch(request) else { return } + guard let accounts = try? context.managedObjectContext.fetch(request), accounts.count > 1 else { return } let nextSelectedAccountIndex: Int? = { for (index, account) in accounts.enumerated() {