Clear demo data, namespace storage by user, add profile setup

- Remove all personal sampleTasks from TaskViewModel (tasks start empty)
- Namespace UserDefaults keys by Apple ID for task and workout data isolation
- Add ProfileSetupView for name capture after first Sign in with Apple
- Add updateDisplayName() to AuthManager
- Route to ProfileSetupView when user has no display name yet

Co-Authored-By: Kutesir <tqwyy79vzn@privaterelay.appleid.com>
This commit is contained in:
Robin Kutesa
2026-06-01 01:31:55 +03:00
parent ac7f2d0614
commit d424a2a814
6 changed files with 213 additions and 79 deletions

View File

@@ -59,6 +59,14 @@ final class AuthManager: NSObject, ObservableObject {
}
}
// MARK: - Profile
func updateDisplayName(_ name: String) {
guard var user = currentUser, !name.trimmingCharacters(in: .whitespaces).isEmpty else { return }
user.displayName = name.trimmingCharacters(in: .whitespaces)
persist(user)
}
// MARK: - Sign Out
func signOut() {