disable unsaved profile warning for now
This commit is contained in:
		
							parent
							
								
									d186f0c190
								
							
						
					
					
						commit
						966dc71e5b
					
				| 
						 | 
					@ -4,7 +4,7 @@
 | 
				
			||||||
  import PromptNotice from './PromptNotice.svelte'
 | 
					  import PromptNotice from './PromptNotice.svelte'
 | 
				
			||||||
  import { addChat, getChat } from './Storage.svelte'
 | 
					  import { addChat, getChat } from './Storage.svelte'
 | 
				
			||||||
  import { replace } from 'svelte-spa-router'
 | 
					  import { replace } from 'svelte-spa-router'
 | 
				
			||||||
  import PromptConfirm from './PromptConfirm.svelte'
 | 
					  // import PromptConfirm from './PromptConfirm.svelte'
 | 
				
			||||||
  import type { ChatSettings } from './Types.svelte'
 | 
					  import type { ChatSettings } from './Types.svelte'
 | 
				
			||||||
  export const sizeTextElements = () => {
 | 
					  export const sizeTextElements = () => {
 | 
				
			||||||
    const els = document.querySelectorAll('textarea.auto-size')
 | 
					    const els = document.querySelectorAll('textarea.auto-size')
 | 
				
			||||||
| 
						 | 
					@ -131,19 +131,20 @@
 | 
				
			||||||
      const chatId = addChat(profile)
 | 
					      const chatId = addChat(profile)
 | 
				
			||||||
      replace(`/chat/${chatId}`)
 | 
					      replace(`/chat/${chatId}`)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (activeChatId && getChat(activeChatId).settings.isDirty) {
 | 
					    // if (activeChatId && getChat(activeChatId).settings.isDirty) {
 | 
				
			||||||
      openModal(PromptConfirm, {
 | 
					    //   openModal(PromptConfirm, {
 | 
				
			||||||
        title: 'Unsaved Profile',
 | 
					    //     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>',
 | 
					    //     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,
 | 
					    //     asHtml: true,
 | 
				
			||||||
        class: 'is-warning',
 | 
					    //     class: 'is-warning',
 | 
				
			||||||
        onConfirm: () => {
 | 
					    //     onConfirm: () => {
 | 
				
			||||||
 | 
					    //       newChat()
 | 
				
			||||||
 | 
					    //     }
 | 
				
			||||||
 | 
					    //   })
 | 
				
			||||||
 | 
					    // } else {
 | 
				
			||||||
 | 
					    //   newChat()
 | 
				
			||||||
 | 
					    // }
 | 
				
			||||||
    newChat()
 | 
					    newChat()
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
      })
 | 
					 | 
				
			||||||
    } else {
 | 
					 | 
				
			||||||
      newChat()
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
</script> 
 | 
					</script> 
 | 
				
			||||||
		Loading…
	
		Reference in New Issue