Suggest login on launch
This commit is contained in:
parent
a5308730f8
commit
150cb5a8c5
|
@ -52,8 +52,10 @@ struct AddAccountView: View {
|
|||
.background(theme.secondaryBackgroundColor)
|
||||
.scrollDismissesKeyboard(.immediately)
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .navigationBarLeading) {
|
||||
Button("Cancel", action: { dismiss() })
|
||||
if !appAccountsManager.availableAccounts.isEmpty {
|
||||
ToolbarItem(placement: .navigationBarLeading) {
|
||||
Button("Cancel", action: { dismiss() })
|
||||
}
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
|
|
|
@ -37,6 +37,9 @@ struct TimelineTab: View {
|
|||
Task {
|
||||
await currentAccount.fetchLists()
|
||||
}
|
||||
if !client.isAuth {
|
||||
routeurPath.presentedSheet = .addAccount
|
||||
}
|
||||
}
|
||||
.onChange(of: client.isAuth, perform: { isAuth in
|
||||
timeline = isAuth ? .home : .federated
|
||||
|
|
|
@ -26,11 +26,27 @@ public struct ExploreView: View {
|
|||
}
|
||||
} else if !viewModel.isLoaded {
|
||||
loadingView
|
||||
} else if viewModel.trendingLinks.isEmpty &&
|
||||
viewModel.trendingTags.isEmpty &&
|
||||
viewModel.trendingStatuses.isEmpty &&
|
||||
viewModel.suggestedAccounts.isEmpty {
|
||||
EmptyView(iconName: "magnifyingglass",
|
||||
title: "Search your instance",
|
||||
message: "From this screen you can search anything on \(client.server)")
|
||||
.listRowBackground(theme.secondaryBackgroundColor)
|
||||
} else {
|
||||
trendingTagsSection
|
||||
suggestedAccountsSection
|
||||
trendingPostsSection
|
||||
trendingLinksSection
|
||||
if !viewModel.trendingTags.isEmpty {
|
||||
trendingTagsSection
|
||||
}
|
||||
if !viewModel.suggestedAccounts.isEmpty {
|
||||
suggestedAccountsSection
|
||||
}
|
||||
if !viewModel.trendingStatuses.isEmpty {
|
||||
trendingPostsSection
|
||||
}
|
||||
if !viewModel.trendingLinks.isEmpty {
|
||||
trendingLinksSection
|
||||
}
|
||||
}
|
||||
}
|
||||
.task {
|
||||
|
|
Loading…
Reference in New Issue