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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user