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