aboutsummaryrefslogtreecommitdiff
path: root/Hotline/macOS/ServerView.swift
diff options
context:
space:
mode:
Diffstat (limited to 'Hotline/macOS/ServerView.swift')
-rw-r--r--Hotline/macOS/ServerView.swift13
1 files changed, 9 insertions, 4 deletions
diff --git a/Hotline/macOS/ServerView.swift b/Hotline/macOS/ServerView.swift
index 4026e92..d490c1b 100644
--- a/Hotline/macOS/ServerView.swift
+++ b/Hotline/macOS/ServerView.swift
@@ -92,7 +92,6 @@ struct ServerView: View {
@State private var connectionDisplayed: Bool = false
// @State private var accountsShown: Bool = false
- @State private var autoconnect: Bool = false
static var menuItems: [ServerMenuItem] = [
ServerMenuItem(type: .chat, name: "Chat", image: "Section Chat"),
ServerMenuItem(type: .board, name: "Board", image: "Section Board"),
@@ -239,6 +238,15 @@ struct ServerView: View {
.focusedSceneValue(\.activeServerState, state)
}
+ private func startReconnectTimer() {
+ reconnectTimer = Task {
+ while !Task.isCancelled {
+ connectToServer()
+ try? await Task.sleep(for: .seconds(5))
+ }
+ }
+ }
+
private var connectForm: some View {
ConnectView(address: self.$connectAddress, login: self.$connectLogin, password: self.$connectPassword) {
self.connectToServer()
@@ -255,9 +263,6 @@ struct ServerView: View {
.onChange(of: self.connectPassword) {
self.server.password = self.connectPassword
}
- .onAppear {
- autoconnect = false
- }
}
private var navigationList: some View {