Skip to content

Commit bedf3f8

Browse files
author
pompurin404
committed
fix update error
1 parent 71bb2c5 commit bedf3f8

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/main/config/profile.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,12 @@ export async function updateProfileItem(item: IProfileItem): Promise<void> {
5555
}
5656
config.items[index] = item
5757
await setProfileConfig(config)
58-
await addProfileUpdater(item)
5958
}
6059

6160
export async function addProfileItem(item: Partial<IProfileItem>): Promise<void> {
6261
const newItem = await createProfile(item)
6362
const config = await getProfileConfig()
64-
if (await getProfileItem(item.id)) {
63+
if (await getProfileItem(newItem.id)) {
6564
await updateProfileItem(newItem)
6665
} else {
6766
config.items.push(newItem)

src/renderer/src/pages/profiles.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ const Profiles: React.FC = () => {
3535
setImporting(true)
3636
try {
3737
await addProfileItem({ name: '', type: 'remote', url })
38+
} catch (e) {
39+
alert(e)
3840
} finally {
3941
setImporting(false)
4042
}

0 commit comments

Comments
 (0)