@@ -93,75 +93,65 @@ export const AppLink: FC<AppLinkProps> = ({ app, workspace, agent }) => {
93
93
94
94
const isPrivateApp = app . sharing_level === "owner" ;
95
95
96
- const button = (
97
- < AgentButton
98
- startIcon = { icon }
99
- endIcon = { isPrivateApp ? undefined : < ShareIcon app = { app } /> }
100
- disabled = { ! canClick }
101
- >
102
- < span
103
- css = {
104
- ! isPrivateApp && {
105
- marginRight : 8 ,
106
- }
107
- }
108
- >
109
- { appDisplayName }
110
- </ span >
111
- </ AgentButton >
112
- ) ;
113
-
114
96
return (
115
97
< Tooltip title = { primaryTooltip } >
116
- < span >
117
- < Link
118
- href = { href }
119
- target = "_blank"
120
- css = { {
121
- pointerEvents : canClick ? undefined : "none" ,
122
- textDecoration : "none !important" ,
123
- } }
124
- onClick = {
125
- canClick
126
- ? async ( event ) => {
127
- event . preventDefault ( ) ;
128
- // This is an external URI like "vscode://", so
129
- // it needs to be opened with the browser protocol handler.
130
- if ( app . external && ! app . url . startsWith ( "http" ) ) {
131
- // If the protocol is external the browser does not
132
- // redirect the user from the page.
98
+ < Link
99
+ color = "inherit"
100
+ component = { AgentButton }
101
+ startIcon = { icon }
102
+ endIcon = { isPrivateApp ? undefined : < ShareIcon app = { app } /> }
103
+ disabled = { ! canClick }
104
+ href = { href }
105
+ target = "_blank"
106
+ css = { {
107
+ pointerEvents : canClick ? undefined : "none" ,
108
+ textDecoration : "none !important" ,
109
+ } }
110
+ onClick = {
111
+ canClick
112
+ ? async ( event ) => {
113
+ event . preventDefault ( ) ;
114
+ // This is an external URI like "vscode://", so
115
+ // it needs to be opened with the browser protocol handler.
116
+ if ( app . external && ! app . url . startsWith ( "http" ) ) {
117
+ // If the protocol is external the browser does not
118
+ // redirect the user from the page.
133
119
134
- // This is a magic undocumented string that is replaced
135
- // with a brand-new session token from the backend.
136
- // This only exists for external URLs, and should only
137
- // be used internally, and is highly subject to break.
138
- const magicTokenString = "$SESSION_TOKEN" ;
139
- const hasMagicToken = href . indexOf ( magicTokenString ) ;
140
- let url = href ;
141
- if ( hasMagicToken !== - 1 ) {
142
- setFetchingSessionToken ( true ) ;
143
- const key = await getApiKey ( ) ;
144
- url = href . replaceAll ( magicTokenString , key . key ) ;
145
- setFetchingSessionToken ( false ) ;
146
- }
147
- window . location . href = url ;
148
- } else {
149
- window . open (
150
- href ,
151
- Language . appTitle (
152
- appDisplayName ,
153
- generateRandomString ( 12 ) ,
154
- ) ,
155
- "width=900,height=600" ,
156
- ) ;
120
+ // This is a magic undocumented string that is replaced
121
+ // with a brand-new session token from the backend.
122
+ // This only exists for external URLs, and should only
123
+ // be used internally, and is highly subject to break.
124
+ const magicTokenString = "$SESSION_TOKEN" ;
125
+ const hasMagicToken = href . indexOf ( magicTokenString ) ;
126
+ let url = href ;
127
+ if ( hasMagicToken !== - 1 ) {
128
+ setFetchingSessionToken ( true ) ;
129
+ const key = await getApiKey ( ) ;
130
+ url = href . replaceAll ( magicTokenString , key . key ) ;
131
+ setFetchingSessionToken ( false ) ;
157
132
}
133
+ window . location . href = url ;
134
+ } else {
135
+ window . open (
136
+ href ,
137
+ Language . appTitle ( appDisplayName , generateRandomString ( 12 ) ) ,
138
+ "width=900,height=600" ,
139
+ ) ;
158
140
}
159
- : undefined
141
+ }
142
+ : undefined
143
+ }
144
+ >
145
+ < span
146
+ css = {
147
+ ! isPrivateApp && {
148
+ marginRight : 8 ,
149
+ }
160
150
}
161
151
>
162
- { button }
163
- </ Link >
164
- </ span >
152
+ { appDisplayName }
153
+ </ span >
154
+ </ Link >
165
155
</ Tooltip >
166
156
) ;
167
157
} ;
0 commit comments