remove unused slow umpire stat view

fix a bit of loading time
sync_v2
Raz 8 months ago
parent 093d67f469
commit 081749cc4e
  1. 16
      PadelClub.xcodeproj/project.pbxproj
  2. 23
      PadelClub/Data/Tournament.swift
  3. 16
      PadelClub/Views/Navigation/Umpire/UmpireView.swift
  4. 14
      PadelClub/Views/Player/PlayerDetailView.swift

@ -3632,7 +3632,7 @@
CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements; CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 2;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\""; DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\"";
@ -3658,7 +3658,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.2.2; MARKETING_VERSION = 1.2.1;
PRODUCT_BUNDLE_IDENTIFIER = app.padelclub; PRODUCT_BUNDLE_IDENTIFIER = app.padelclub;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
@ -3678,7 +3678,7 @@
CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements; CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 2;
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\""; DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\"";
DEVELOPMENT_TEAM = BQ3Y44M3Q6; DEVELOPMENT_TEAM = BQ3Y44M3Q6;
@ -3703,7 +3703,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.2.2; MARKETING_VERSION = 1.2.1;
PRODUCT_BUNDLE_IDENTIFIER = app.padelclub; PRODUCT_BUNDLE_IDENTIFIER = app.padelclub;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
@ -3795,7 +3795,7 @@
CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements; CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 2;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\""; DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\"";
@ -3821,7 +3821,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.1.1; MARKETING_VERSION = 1.2.1;
PRODUCT_BUNDLE_IDENTIFIER = app.padelclub; PRODUCT_BUNDLE_IDENTIFIER = app.padelclub;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
@ -3841,7 +3841,7 @@
CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements; CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 2;
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\""; DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\"";
DEVELOPMENT_TEAM = BQ3Y44M3Q6; DEVELOPMENT_TEAM = BQ3Y44M3Q6;
@ -3866,7 +3866,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.1.1; MARKETING_VERSION = 1.2.1;
PRODUCT_BUNDLE_IDENTIFIER = app.padelclub; PRODUCT_BUNDLE_IDENTIFIER = app.padelclub;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";

@ -19,7 +19,7 @@ final class Tournament: BaseTournament {
func shouldRefreshTeams() -> Bool { func shouldRefreshTeams() -> Bool {
guard let lastTeamRefresh else { return true } guard let lastTeamRefresh else { return true }
return lastTeamRefresh.timeIntervalSinceNow < -60 return lastTeamRefresh.timeIntervalSinceNow < -600
} }
@ObservationIgnored @ObservationIgnored
@ -2337,6 +2337,10 @@ defer {
// MARK: - Status // MARK: - Status
func shouldTournamentBeOver() async -> Bool { func shouldTournamentBeOver() async -> Bool {
return false
if tournamentStore?.store.fileCollectionsAllLoaded() == false {
return false
}
#if _DEBUGING_TIME //DEBUGING TIME #if _DEBUGING_TIME //DEBUGING TIME
let start = Date() let start = Date()
defer { defer {
@ -2378,24 +2382,19 @@ defer {
func refreshTeamList() async { func refreshTeamList() async {
guard StoreCenter.main.isAuthenticated else { return } guard StoreCenter.main.isAuthenticated else { return }
guard tournamentStore?.store.fileCollectionsAllLoaded() == true else { return }
guard shouldRefreshTeams(), refreshInProgress == false, enableOnlineRegistration, hasEnded() == false else { return } guard shouldRefreshTeams(), refreshInProgress == false, enableOnlineRegistration, hasEnded() == false else { return }
await MainActor.run { refreshInProgress = true
refreshInProgress = true
}
do { do {
try await self.tournamentStore?.playerRegistrations.loadDataFromServerIfAllowed(clear: true) try await self.tournamentStore?.playerRegistrations.loadDataFromServerIfAllowed(clear: true)
try await self.tournamentStore?.teamScores.loadDataFromServerIfAllowed(clear: true) try await self.tournamentStore?.teamScores.loadDataFromServerIfAllowed(clear: true)
try await self.tournamentStore?.teamRegistrations.loadDataFromServerIfAllowed(clear: true) try await self.tournamentStore?.teamRegistrations.loadDataFromServerIfAllowed(clear: true)
await MainActor.run { refreshInProgress = false
refreshInProgress = false lastTeamRefresh = Date()
lastTeamRefresh = Date()
}
} catch { } catch {
Logger.error(error) Logger.error(error)
await MainActor.run { refreshInProgress = false
refreshInProgress = false lastTeamRefresh = Date()
lastTeamRefresh = Date()
}
} }
} }

@ -121,14 +121,14 @@ struct UmpireView: View {
Text("Il s'agit des clubs qui sont utilisés pour récupérer les tournois tenup.") Text("Il s'agit des clubs qui sont utilisés pour récupérer les tournois tenup.")
} }
Section { // Section {
NavigationLink { // NavigationLink {
UmpireStatisticView() // UmpireStatisticView()
} label: { // } label: {
Text("Statistiques de participations") // Text("Statistiques de participations")
} // }
} // }
//
Section { Section {
@Bindable var user = dataStore.user @Bindable var user = dataStore.user

@ -220,13 +220,13 @@ struct PlayerDetailView: View {
} }
} }
Section { // Section {
NavigationLink { // NavigationLink {
PlayerStatisticView(player: player) // PlayerStatisticView(player: player)
} label: { // } label: {
Text("Statistiques de participations") // Text("Statistiques de participations")
} // }
} // }
} }
.onChange(of: [player.hasArrived, player.captain, player.coach]) { .onChange(of: [player.hasArrived, player.captain, player.coach]) {
_save() _save()

Loading…
Cancel
Save