mirror of
https://github.com/morgan9e/chatgpt-web
synced 2026-04-14 00:14:04 +09:00
specify profile for new chat via uri
This commit is contained in:
@@ -1,8 +1,13 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { querystring } from 'svelte-spa-router'
|
||||||
import { addChat } from './Storage.svelte'
|
import { addChat } from './Storage.svelte'
|
||||||
import { replace } from 'svelte-spa-router'
|
import { replace } from 'svelte-spa-router'
|
||||||
|
import { getProfile } from './Profiles.svelte'
|
||||||
|
|
||||||
// Create the new chat instance then redirect to it
|
// Create the new chat instance then redirect to it
|
||||||
const chatId = addChat()
|
|
||||||
|
const urlParams: URLSearchParams = new URLSearchParams($querystring)
|
||||||
|
const chatId = urlParams.has('p') ? addChat(getProfile(urlParams.get('p') || '')) : addChat()
|
||||||
|
|
||||||
replace(`/chat/${chatId}`)
|
replace(`/chat/${chatId}`)
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user