@@ -5,7 +5,6 @@ import { useHotkeys } from "react-hotkeys-hook";
55import { DEFAULT_ONA_ENDPOINT , EVENT_CURRENT_URL_CHANGED } from "~constants" ;
66import { OnaLettermark } from "~icons/OnaLettermark" ;
77import { STORAGE_KEY_ADDRESS , STORAGE_KEY_ALWAYS_OPTIONS , STORAGE_KEY_NEW_TAB } from "~storage" ;
8- import { isOnaEndpoint } from "~utils/parse-endpoint" ;
98import type { SupportedApplication } from "./button-contributions" ;
109import { CaretForProvider } from "./CaretForProvider" ;
1110
@@ -35,15 +34,12 @@ export const OnaButton = ({ application, additionalClassNames, urlTransformer }:
3534 } ;
3635 } , [ ] ) ;
3736
38- const isOna = useMemo ( ( ) => address && isOnaEndpoint ( address ) , [ address ] ) ;
3937 const actions = useMemo ( ( ) => {
4038 const parsedHref = ! urlTransformer ? currentHref : urlTransformer ( currentHref ) ;
4139
42- const autoStartParam = isOna ? "" : "?autostart=true" ;
43-
4440 return [
4541 {
46- href : `${ address } /${ autoStartParam } #${ parsedHref } ` ,
42+ href : `${ address } /?autostart= ${ disableAutostart ? "false" : "true" } #${ parsedHref } ` ,
4743 label : "Open" ,
4844 } ,
4945 {
@@ -56,7 +52,6 @@ export const OnaButton = ({ application, additionalClassNames, urlTransformer }:
5652 const firstActionRef = useRef < HTMLAnchorElement | null > ( null ) ;
5753
5854 const target = openInNewTab ? "_blank" : "_self" ;
59- const effectiveDisableAutostart = isOna ? true : disableAutostart ;
6055
6156 const toggleDropdown = ( ) => {
6257 setShowDropdown ( ! showDropdown ) ;
@@ -91,7 +86,7 @@ export const OnaButton = ({ application, additionalClassNames, urlTransformer }:
9186 >
9287 < div className = { classNames ( "button" ) } >
9388 < a
94- className = { classNames ( "button-part" , effectiveDisableAutostart ? "action-no-options" : "action" ) }
89+ className = { classNames ( "button-part" , disableAutostart ? "action-no-options" : "action" ) }
9590 href = { actions [ 0 ] . href }
9691 target = { target }
9792 rel = "noreferrer"
@@ -102,7 +97,7 @@ export const OnaButton = ({ application, additionalClassNames, urlTransformer }:
10297 { actions [ 0 ] . label }
10398 </ span >
10499 </ a >
105- { ! effectiveDisableAutostart && (
100+ { ! disableAutostart && (
106101 < button
107102 className = { classNames ( "button-part" , "action-chevron" ) }
108103 onClick = { ( e ) => {
0 commit comments