File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed
modules/selector-auto-detector Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -93,23 +93,23 @@ window.OneClickPromptsSelectorAutoDetector = {
9393 // Readable name for the type
9494 const typeName = type === 'editor' ? 'Text input area' : 'send button' ;
9595
96- // If heuristics are disabled, still notify the user but skip the scan.
96+ // Unified message logic
97+ const statusSuffix = heuristicsAllowed ? "Trying to find it..." : "Auto-detect is off." ;
98+ const toastType = heuristicsAllowed ? 'info' : 'error' ;
99+
100+ if ( window . showToast ) {
101+ window . showToast ( `OneClickPrompts: ${ typeName } not found. ${ statusSuffix } ` , toastType ) ;
102+ } else {
103+ console . warn ( `OneClickPrompts: ${ typeName } not found. ${ statusSuffix } ` ) ;
104+ }
105+
106+ // If heuristics are disabled, stop here.
97107 if ( ! heuristicsAllowed ) {
98108 logConCgp ( `[SelectorAutoDetector] Heuristics disabled for ${ type } ; skipping recovery.` ) ;
99- if ( window . showToast ) {
100- window . showToast ( `OneClickPrompts: ${ typeName } not found. Auto-detect is off.` , 'error' ) ;
101- }
102109 s . recovering = false ;
103110 return null ;
104111 }
105112
106- // Notify user
107- if ( window . showToast ) {
108- window . showToast ( `OneClickPrompts: ${ typeName } not found. Trying to find it...` , 'info' ) ;
109- } else {
110- console . warn ( `OneClickPrompts: ${ typeName } not found. Analyzing page structure...` ) ;
111- }
112-
113113 const site = window . InjectionTargetsOnWebsite ?. activeSite || 'Unknown' ;
114114 const heuristics = window . OneClickPromptsSiteHeuristics ?. resolve
115115 ? window . OneClickPromptsSiteHeuristics . resolve ( site )
You can’t perform that action at this time.
0 commit comments