@@ -39,7 +39,7 @@ import {
39
39
toOllamaModel ,
40
40
type LanguageModel ,
41
41
} from "@cocalc/util/db-schema/llm-utils" ;
42
- import { cmp , isValidUUID , parse_hashtags , uuid } from "@cocalc/util/misc" ;
42
+ import { cmp , isValidUUID , uuid } from "@cocalc/util/misc" ;
43
43
import { reuseInFlight } from "@cocalc/util/reuse-in-flight" ;
44
44
import { getSortedDates , getUserName } from "./chat-log" ;
45
45
import { message_to_markdown } from "./message" ;
@@ -51,7 +51,6 @@ import {
51
51
Feedback ,
52
52
MessageHistory ,
53
53
} from "./types" ;
54
- import { getSelectedHashtagsSearch } from "./utils" ;
55
54
import { history_path } from "@cocalc/util/misc" ;
56
55
57
56
const MAX_CHATSTREAM = 10 ;
@@ -302,7 +301,6 @@ export class ChatActions extends Actions<ChatState> {
302
301
search : "" ,
303
302
} ) ;
304
303
}
305
- this . ensureDraftStartsWithHashtags ( false ) ;
306
304
307
305
if ( this . store != null ) {
308
306
const project_id = this . store ?. get ( "project_id" ) ;
@@ -621,38 +619,6 @@ export class ChatActions extends Actions<ChatState> {
621
619
? selectedHashtags . delete ( tag )
622
620
: selectedHashtags . set ( tag , state ) ;
623
621
this . setState ( { selectedHashtags } ) ;
624
- this . ensureDraftStartsWithHashtags ( true ) ;
625
- }
626
-
627
- private ensureDraftStartsWithHashtags ( commit : boolean = false ) : void {
628
- if ( this . syncdb == null || this . store == null ) return ;
629
- // set draft input to match selected hashtags, if any.
630
- const hashtags = this . store . get ( "selectedHashtags" ) ;
631
- if ( hashtags == null ) return ;
632
- const { selectedHashtagsSearch } = getSelectedHashtagsSearch ( hashtags ) ;
633
- let input = this . store . get ( "input" ) ;
634
- const prefix = selectedHashtagsSearch . trim ( ) + " " ;
635
- if ( input . startsWith ( prefix ) ) {
636
- return ;
637
- }
638
- const v = parse_hashtags ( input ) ;
639
- if ( v . length > 0 ) {
640
- input = input . slice ( v [ v . length - 1 ] [ 1 ] ) ;
641
- }
642
-
643
- input = prefix + input ;
644
- this . setState ( { input } ) ;
645
- const sender_id = this . redux . getStore ( "account" ) . get_account_id ( ) ;
646
- this . syncdb . set ( {
647
- event : "draft" ,
648
- active : Date . now ( ) ,
649
- sender_id,
650
- input,
651
- date : 0 ,
652
- } ) ;
653
- if ( commit ) {
654
- this . syncdb . commit ( ) ;
655
- }
656
622
}
657
623
658
624
public help ( ) {
0 commit comments