disable unsaved profile warning for now

This commit is contained in:
Webifi 2023-07-17 14:09:25 -05:00
parent d186f0c190
commit 966dc71e5b
1 changed files with 15 additions and 14 deletions

View File

@ -4,7 +4,7 @@
import PromptNotice from './PromptNotice.svelte'
import { addChat, getChat } from './Storage.svelte'
import { replace } from 'svelte-spa-router'
import PromptConfirm from './PromptConfirm.svelte'
// import PromptConfirm from './PromptConfirm.svelte'
import type { ChatSettings } from './Types.svelte'
export const sizeTextElements = () => {
const els = document.querySelectorAll('textarea.auto-size')
@ -131,19 +131,20 @@
const chatId = addChat(profile)
replace(`/chat/${chatId}`)
}
if (activeChatId && getChat(activeChatId).settings.isDirty) {
openModal(PromptConfirm, {
title: 'Unsaved Profile',
message: '<p>There are unsaved changes to your current profile that will be lost.</p><p>Discard these changes and continue with new chat?</p>',
asHtml: true,
class: 'is-warning',
onConfirm: () => {
// if (activeChatId && getChat(activeChatId).settings.isDirty) {
// openModal(PromptConfirm, {
// title: 'Unsaved Profile',
// message: '<p>There are unsaved changes to your current profile that will be lost.</p><p>Discard these changes and continue with new chat?</p>',
// asHtml: true,
// class: 'is-warning',
// onConfirm: () => {
// newChat()
// }
// })
// } else {
// newChat()
// }
newChat()
}
})
} else {
newChat()
}
}
</script>