Skip to content

Commit c94ce78

Browse files
fix(web): removing a browser profile in project scope deletes its data and the profile together
Profile create, rename and remove pair a settings write with profile data (clearing or importing cookies), so a project-scope refusal after the data step left an orphaned or emptied profile. They save for this device again, as before; only "Set as default" goes through the scoped write. AI-assisted; verified with the tests and tools listed above.
1 parent 9422dee commit c94ce78

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎apps/web/src/components/settings/IntegrationsSettings.tsx‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,7 +1111,9 @@ function BrowserProfilesSetting({ disabled }: { readonly disabled: boolean }) {
11111111
const userProfiles = useClientSettings((settings) => settings.browserProfiles);
11121112
const defaultProfileId = useClientSettings((settings) => settings.browserDefaultProfileId);
11131113
const settingsHydrated = useClientSettingsHydrated();
1114-
const updateSettings = useUpdateScopedSettings();
1114+
// Profile edits pair with profile data on disk, so they save for this device in every scope.
1115+
const updateSettings = useUpdatePrimarySettings();
1116+
const updateDefaultProfile = useUpdateScopedSettings();
11151117
const { environments, isReady: environmentsReady } = useEnvironments();
11161118
const primaryEnvironment = usePrimaryEnvironment();
11171119
// Cookie import runs on this desktop, whose policy the primary environment reports.
@@ -1422,7 +1424,7 @@ function BrowserProfilesSetting({ disabled }: { readonly disabled: boolean }) {
14221424
disabled={!settingsHydrated || isDefault}
14231425
onClick={() => {
14241426
if (settingsHydrated) {
1425-
updateSettings({ browserDefaultProfileId: profile.id });
1427+
updateDefaultProfile({ browserDefaultProfileId: profile.id });
14261428
}
14271429
}}
14281430
>

0 commit comments

Comments
 (0)