Skip to content

Commit e6bf948

Browse files
fix(web): don't leave an empty profile behind when import can't start
`importInto` created the target profile before `runImport` checked for an environment and a bridge, so choosing an import target before the environment resolved left a new empty profile named after the source browser and produced no toast at all. The check now happens first and says what went wrong. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 6b6e581 commit e6bf948

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,17 @@ function BrowserProfilesSetting({ disabled }: { readonly disabled: boolean }) {
657657
sourceProfileDirectory: string,
658658
target: "new" | { readonly id: string; readonly name: string },
659659
) => {
660+
// Checked before creating anything. `runImport` bails on the same
661+
// condition, so creating first left an empty profile named after the
662+
// source browser behind, with no toast to explain it.
663+
if (!environmentId || !previewBridge) {
664+
toastManager.add({
665+
type: "error",
666+
title: `Could not import from ${source.name}`,
667+
description: "No environment is connected yet.",
668+
});
669+
return;
670+
}
660671
if (target === "new") {
661672
const created = createProfile(source.name);
662673
runImport(source, sourceProfileDirectory, created.id, created.name);

0 commit comments

Comments
 (0)