Clean up prompts
This commit is contained in:
parent
ec3478f159
commit
d1cabf0071
|
@ -33,6 +33,8 @@
|
|||
import ChatSettingField from './ChatSettingField.svelte'
|
||||
import { getModelMaxTokens } from './Stats.svelte'
|
||||
import { replace } from 'svelte-spa-router'
|
||||
import { openModal } from 'svelte-modals'
|
||||
import PromptConfirm from './PromptConfirm.svelte'
|
||||
|
||||
export let chatId:number
|
||||
export const show = () => { showSettings() }
|
||||
|
@ -105,6 +107,17 @@
|
|||
}
|
||||
}
|
||||
|
||||
const promptDeleteProfile = () => {
|
||||
openModal(PromptConfirm, {
|
||||
title: 'Delete Profile',
|
||||
message: 'Are you sure you want to delete this profile?',
|
||||
class: 'is-warning',
|
||||
onConfirm: () => {
|
||||
deleteProfile()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const deleteProfile = () => {
|
||||
showProfileMenu = false
|
||||
try {
|
||||
|
@ -309,7 +322,7 @@
|
|||
<span class="menu-icon"><Fa icon={faUpload}/></span> Restore Profile JSON
|
||||
</a>
|
||||
<hr class="dropdown-divider">
|
||||
<a href={'#'} class="dropdown-item" on:click|preventDefault={deleteProfile}>
|
||||
<a href={'#'} class="dropdown-item" on:click|preventDefault={promptDeleteProfile}>
|
||||
<span class="menu-icon"><Fa icon={faTrash}/></span> Delete Profile
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
@ -10,9 +10,9 @@
|
|||
export let onConfirm:()=>boolean|void
|
||||
export let onCancel:(()=>boolean|void)|null = null
|
||||
|
||||
export let confirmButton:string = 'Okay'
|
||||
export let confirmButton:string = 'Yes'
|
||||
export let confirmButtonClass:string = 'is-info'
|
||||
export let cancelButton:string = 'Cancel'
|
||||
export let cancelButton:string = 'No'
|
||||
export let cancelButtonClass:string = ''
|
||||
let classes:string = ''
|
||||
export { classes as class }
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
export let onConfirm:(()=>boolean|void)|null = null
|
||||
|
||||
export let confirmButton:string = 'Okay'
|
||||
export let confirmButton:string = 'Close'
|
||||
export let confirmButtonClass:string = 'is-info'
|
||||
let classes:string = ''
|
||||
export { classes as class }
|
||||
|
|
Loading…
Reference in New Issue