|
|
|
@ -15,6 +15,7 @@ struct MainView: View { |
|
|
|
|
|
|
|
|
|
|
|
@State private var checkingFilesAttempt: Int = 0 |
|
|
|
@State private var checkingFilesAttempt: Int = 0 |
|
|
|
@State private var checkingFiles: Bool = false |
|
|
|
@State private var checkingFiles: Bool = false |
|
|
|
|
|
|
|
@State private var mainViewId: UUID = UUID() |
|
|
|
|
|
|
|
|
|
|
|
var lastDataSource: String? { |
|
|
|
var lastDataSource: String? { |
|
|
|
dataStore.appSettings.lastDataSource |
|
|
|
dataStore.appSettings.lastDataSource |
|
|
|
@ -81,9 +82,12 @@ struct MainView: View { |
|
|
|
// PadelClubView() |
|
|
|
// PadelClubView() |
|
|
|
// .tabItem(for: .padelClub) |
|
|
|
// .tabItem(for: .padelClub) |
|
|
|
} |
|
|
|
} |
|
|
|
.id(dataStore.user.id) |
|
|
|
.id(mainViewId) |
|
|
|
.onChange(of: dataStore.user.id) { |
|
|
|
.onChange(of: dataStore.user.id) { |
|
|
|
navigation.path.removeLast(navigation.path.count) |
|
|
|
if Store.main.userId == nil { // user disconnected |
|
|
|
|
|
|
|
navigation.path.removeLast(navigation.path.count) |
|
|
|
|
|
|
|
mainViewId = UUID() |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.environmentObject(dataStore) |
|
|
|
.environmentObject(dataStore) |
|
|
|
.task { |
|
|
|
.task { |
|
|
|
|