From 26daf8b06f19d0e836f7d683de43e9531a5fa98a Mon Sep 17 00:00:00 2001 From: Kyle Hickinson Date: Tue, 28 Jan 2025 17:33:04 -0500 Subject: [PATCH] Merge pull request #27378 from brave/ios-cr133-profile-creation-fix [iOS] Use original initial profile name for main profile creation --- ios/app/brave_core_main.mm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ios/app/brave_core_main.mm b/ios/app/brave_core_main.mm index a3ca78f55420..7efe2ca67f06 100644 --- a/ios/app/brave_core_main.mm +++ b/ios/app/brave_core_main.mm @@ -95,12 +95,12 @@ // Initialize and set the main browser state. auto* localState = GetApplicationContext()->GetLocalState(); auto* profileManager = GetApplicationContext()->GetProfileManager(); - std::string profileName = localState->GetString(prefs::kLastUsedProfile); - if (profileName.empty()) { - profileName = profileManager->ReserveNewProfileName(); - localState->SetString(prefs::kLastUsedProfile, profileName); - } - DCHECK(!profileName.empty()); + std::string profileName = + "Default"; // kIOSChromeInitialProfile which is now removed + // Set this as the last used profile always so that its saved for the future + // where we may have multiple profile support and need to read it from local + // state before creating the profile + localState->SetString(prefs::kLastUsedProfile, profileName); ScopedAllowBlockingForProfile allow_blocking; return profileManager->CreateProfile(profileName); }