stable
This commit is contained in:
parent
554ef49a3e
commit
8af86e4eab
|
|
@ -24,7 +24,7 @@ export type LLMMessage = {
|
|||
displayContent?: string;
|
||||
};
|
||||
|
||||
interface LLM {
|
||||
interface LLM {
|
||||
readonly name: string;
|
||||
chatCompletion(messages: LLMMessage[], signal: AbortSignal): AsyncGenerator<string>;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -250,8 +250,11 @@ export function useFlash(): [boolean, EffectCallback] {
|
|||
}
|
||||
|
||||
export function useCookies() {
|
||||
return document.cookie.split('; ').filter(v => v.includes('=')).map(kv => {
|
||||
const separator = kv.indexOf('=');
|
||||
return [kv.substring(0, separator), kv.substring(separator + 1)];
|
||||
});
|
||||
const cookies = React.useMemo(() => {
|
||||
return document.cookie.split('; ').filter(v => v.includes('=')).map(kv => {
|
||||
const separator = kv.indexOf('=');
|
||||
return [kv.substring(0, separator), kv.substring(separator + 1)];
|
||||
});
|
||||
}, [document.cookie]);
|
||||
return cookies;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue