mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-04 05:12:38 +02:00
fix Ask SurfSense: pre-fill with initialText and cursor positioning
This commit is contained in:
parent
f36e5f8287
commit
9f13da3fd1
3 changed files with 24 additions and 15 deletions
|
|
@ -37,6 +37,7 @@ export default function QuickAskPage() {
|
|||
|
||||
const navigateToChat = (prompt: string, mode: string) => {
|
||||
sessionStorage.setItem("quickAskMode", mode);
|
||||
sessionStorage.setItem("quickAskAutoSubmit", "true");
|
||||
const encoded = encodeURIComponent(prompt);
|
||||
window.location.href = `/dashboard?quickAskPrompt=${encoded}`;
|
||||
};
|
||||
|
|
@ -44,8 +45,9 @@ export default function QuickAskPage() {
|
|||
const navigateWithInitialText = () => {
|
||||
if (!clipboardText) return;
|
||||
sessionStorage.setItem("quickAskMode", "explore");
|
||||
const encoded = encodeURIComponent(clipboardText);
|
||||
window.location.href = `/dashboard?quickAskInitialText=${encoded}`;
|
||||
sessionStorage.setItem("quickAskAutoSubmit", "false");
|
||||
sessionStorage.setItem("quickAskInitialText", clipboardText);
|
||||
window.location.href = `/dashboard?quickAskPrompt=${encodeURIComponent(clipboardText)}`;
|
||||
};
|
||||
|
||||
const handleAction = (actionId: string) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue