Simplify alert modals

This commit is contained in:
Webifi
2023-06-05 22:47:55 -05:00
parent e6082144cb
commit 886b3d463d
7 changed files with 31 additions and 27 deletions

View File

@@ -5,8 +5,6 @@
import { getChatSettingObjectByKey, getGlobalSettingObjectByKey, getChatDefaults, getExcludeFromProfile } from './Settings.svelte'
import { v4 as uuidv4 } from 'uuid'
import { getProfile, getProfiles, isStaticProfile, newNameForProfile, restartProfile } from './Profiles.svelte'
import { openModal } from 'svelte-modals'
import PromptNotice from './PromptNotice.svelte'
import { errorNotice } from './Util.svelte'
export const chatsStorage = persisted('chats', [] as Chat[])
@@ -59,11 +57,11 @@
try {
chat = JSON.parse(json) as Chat
if (!chat.settings || !chat.messages || isNaN(chat.id)) {
openModal(PromptNotice, errorNotice('Not valid Chat JSON'))
errorNotice('Not valid Chat JSON')
return 0
}
} catch (err) {
openModal(PromptNotice, errorNotice("Can't parse file JSON"))
errorNotice("Can't parse file JSON")
return 0
}