mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-08 23:32:40 +02:00
fix: move quickAskMode to IPC to prevent sessionStorage leak between windows
This commit is contained in:
parent
9f13da3fd1
commit
58ac17fb81
7 changed files with 32 additions and 11 deletions
|
|
@ -35,16 +35,16 @@ export default function QuickAskPage() {
|
|||
});
|
||||
}, []);
|
||||
|
||||
const navigateToChat = (prompt: string, mode: string) => {
|
||||
sessionStorage.setItem("quickAskMode", mode);
|
||||
const navigateToChat = async (prompt: string, mode: string) => {
|
||||
await window.electronAPI?.setQuickAskMode(mode);
|
||||
sessionStorage.setItem("quickAskAutoSubmit", "true");
|
||||
const encoded = encodeURIComponent(prompt);
|
||||
window.location.href = `/dashboard?quickAskPrompt=${encoded}`;
|
||||
};
|
||||
|
||||
const navigateWithInitialText = () => {
|
||||
const navigateWithInitialText = async () => {
|
||||
if (!clipboardText) return;
|
||||
sessionStorage.setItem("quickAskMode", "explore");
|
||||
await window.electronAPI?.setQuickAskMode("explore");
|
||||
sessionStorage.setItem("quickAskAutoSubmit", "false");
|
||||
sessionStorage.setItem("quickAskInitialText", clipboardText);
|
||||
window.location.href = `/dashboard?quickAskPrompt=${encodeURIComponent(clipboardText)}`;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue