chatgpt-web/src/lib/NewChat.svelte

9 lines
231 B
Svelte

<script lang="ts">
import { addChat } from './Storage.svelte'
import { replace } from 'svelte-spa-router'
// Create the new chat instance then redirect to it
const chatId = addChat()
replace(`/chat/${chatId}`)
</script>