@@ -2,7 +2,7 @@ import { useEffect, useMemo, useRef, useState } from 'react';
22import  {  CallbackGeneratedChunk ,  useAppContext  }  from  '../utils/app.context' ; 
33import  ChatMessage  from  './ChatMessage' ; 
44import  {  CanvasType ,  Message ,  PendingMessage  }  from  '../utils/types' ; 
5- import  {  classNames ,  cleanCurrentUrl ,   throttle  }  from  '../utils/misc' ; 
5+ import  {  classNames ,  throttle  }  from  '../utils/misc' ; 
66import  CanvasPyInterpreter  from  './CanvasPyInterpreter' ; 
77import  StorageUtils  from  '../utils/storage' ; 
88import  {  useVSCodeContext  }  from  '../utils/llama-vscode' ; 
@@ -20,20 +20,21 @@ export interface MessageDisplay {
2020} 
2121
2222/** 
23-  * If the current URL contains "? m=...", prefill the message input with the value. 
24-  * If the current URL contains "? q=...", prefill and SEND the message. 
23+  * If the current URL contains "# m=...", prefill the message input with the value. 
24+  * If the current URL contains "# q=...", prefill and SEND the message. 
2525 */ 
26+ let  init_message_done :boolean = false ; 
27+ let  init_query_done :boolean = false ; 
2628const  prefilledMsg  =  { 
27-   content ( )  { 
28-     const   url   =   new   URL ( window . location . href ) ; 
29-     return   url . searchParams . get ( 'm' )   ??   url . searchParams . get ( 'q' )   ??   '' ; 
29+   clear ( )  { 
30+     init_message_done   =   true ; 
31+     init_query_done   =   true ; 
3032  } , 
31-   shouldSend ( )  { 
32-     const  url  =  new  URL ( window . location . href ) ; 
33-     return  url . searchParams . has ( 'q' ) ; 
33+   content : function ( )  { 
34+     return  init_message_done  ? ''  : INIT_MESSAGE ; 
3435  } , 
35-   clear ( )  { 
36-     cleanCurrentUrl ( [ 'm' ,   'q' ] ) ; 
36+   shouldSend :  function ( )  { 
37+     return   init_query_done  ?  ''  :  INIT_QUERY ; 
3738  } , 
3839} ; 
3940
0 commit comments