mirror of
https://github.com/morgan9e/chatgpt-web
synced 2026-04-13 16:04:05 +09:00
Default to last viewed chat when returning to app
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { apiKeyStorage, lastChatId, getChat, started } from './Storage.svelte'
|
import { apiKeyStorage, lastChatId, getChat, started } from './Storage.svelte'
|
||||||
import Footer from './Footer.svelte'
|
import Footer from './Footer.svelte'
|
||||||
// import { replace } from 'svelte-spa-router'
|
import { replace } from 'svelte-spa-router'
|
||||||
import { onMount } from 'svelte'
|
import { onMount } from 'svelte'
|
||||||
|
|
||||||
$: apiKey = $apiKeyStorage
|
$: apiKey = $apiKeyStorage
|
||||||
@@ -11,9 +11,9 @@ onMount(() => {
|
|||||||
$started = true
|
$started = true
|
||||||
// console.log('started', apiKey, $lastChatId, getChat($lastChatId))
|
// console.log('started', apiKey, $lastChatId, getChat($lastChatId))
|
||||||
if (apiKey && getChat($lastChatId)) {
|
if (apiKey && getChat($lastChatId)) {
|
||||||
// const chatId = $lastChatId
|
const chatId = $lastChatId
|
||||||
$lastChatId = 0
|
$lastChatId = 0
|
||||||
// replace(`/chat/${chatId}`)
|
replace(`/chat/${chatId}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$lastChatId = 0
|
$lastChatId = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user