mirror of
https://github.com/morgan9e/chatgpt-web
synced 2026-04-14 00:14:04 +09:00
Allow Petals and/or OpenAI
This commit is contained in:
@@ -25,11 +25,16 @@
|
||||
export let lastChatId = persisted('lastChatId', 0)
|
||||
|
||||
const chatDefaults = getChatDefaults()
|
||||
|
||||
|
||||
export const getApiKey = (): string => {
|
||||
return get(apiKeyStorage)
|
||||
}
|
||||
|
||||
export const hasActiveModels = (): boolean => {
|
||||
const globalSettings = get(globalStorage) || {}
|
||||
return !!get(apiKeyStorage) || !!globalSettings.enablePetals
|
||||
}
|
||||
|
||||
export const newChatID = (): number => {
|
||||
const chats = get(chatsStorage)
|
||||
const chatId = chats.reduce((maxId, chat) => Math.max(maxId, chat.id), 0) + 1
|
||||
|
||||
Reference in New Issue
Block a user