diff --git a/src/main/config/profile.ts b/src/main/config/profile.ts index e8425c2..2bc23ea 100644 --- a/src/main/config/profile.ts +++ b/src/main/config/profile.ts @@ -55,13 +55,12 @@ export async function updateProfileItem(item: IProfileItem): Promise { } config.items[index] = item await setProfileConfig(config) - await addProfileUpdater(item) } export async function addProfileItem(item: Partial): Promise { const newItem = await createProfile(item) const config = await getProfileConfig() - if (await getProfileItem(item.id)) { + if (await getProfileItem(newItem.id)) { await updateProfileItem(newItem) } else { config.items.push(newItem) diff --git a/src/renderer/src/pages/profiles.tsx b/src/renderer/src/pages/profiles.tsx index 1fc5a24..766dc2c 100644 --- a/src/renderer/src/pages/profiles.tsx +++ b/src/renderer/src/pages/profiles.tsx @@ -35,6 +35,8 @@ const Profiles: React.FC = () => { setImporting(true) try { await addProfileItem({ name: '', type: 'remote', url }) + } catch (e) { + alert(e) } finally { setImporting(false) }