Remove purge button

This commit is contained in:
Ethan Pippin 2021-10-15 01:06:15 -06:00
parent 3c26b55fc4
commit b046331936
2 changed files with 9 additions and 39 deletions

View File

@ -95,25 +95,10 @@ struct ServerListView: View {
if viewModel.servers.isEmpty {
EmptyView()
} else {
HStack {
Button {
SwiftfinStore.dataStack.perform(asynchronous: { transaction in
try! transaction.deleteAll(From<SwiftfinStore.Models.StoredServer>())
try! transaction.deleteAll(From<SwiftfinStore.Models.StoredUser>())
try! transaction.deleteAll(From<SwiftfinStore.Models.StoredAccessToken>())
}) { _ in
SwiftfinStore.Defaults.suite[.lastServerUserID] = nil
viewModel.fetchServers()
}
} label: {
Text("Purge")
}
Button {
serverListRouter.route(to: \.connectToServer)
} label: {
Image(systemName: "plus.circle.fill")
}
Button {
serverListRouter.route(to: \.connectToServer)
} label: {
Image(systemName: "plus.circle.fill")
}
}
}

View File

@ -29,7 +29,7 @@ struct ServerListView: View {
.frame(height: 100)
.cornerRadius(10)
HStack {
HStack(spacing: 10) {
Image(systemName: "server.rack")
.font(.system(size: 36))
.foregroundColor(.primary)
@ -106,25 +106,10 @@ struct ServerListView: View {
if viewModel.servers.isEmpty {
EmptyView()
} else {
HStack {
Button {
SwiftfinStore.dataStack.perform(asynchronous: { transaction in
try! transaction.deleteAll(From<SwiftfinStore.Models.StoredServer>())
try! transaction.deleteAll(From<SwiftfinStore.Models.StoredUser>())
try! transaction.deleteAll(From<SwiftfinStore.Models.StoredAccessToken>())
}) { _ in
SwiftfinStore.Defaults.suite[.lastServerUserID] = nil
viewModel.fetchServers()
}
} label: {
Text("Purge")
}
Button {
serverListRouter.route(to: \.connectToServer)
} label: {
Image(systemName: "plus.circle.fill")
}
Button {
serverListRouter.route(to: \.connectToServer)
} label: {
Image(systemName: "plus.circle.fill")
}
}
}