(host: SlashCommandHost, id: string)
| 251 | } |
| 252 | |
| 253 | async function confirmRemovePlugin(host: SlashCommandHost, id: string): Promise<boolean> { |
| 254 | let displayName = id; |
| 255 | try { |
| 256 | displayName = (await host.requireSession().getPluginInfo(id)).displayName; |
| 257 | } catch { |
| 258 | // Keep the confirmation available even when plugin details cannot be loaded. |
| 259 | } |
| 260 | |
| 261 | return new Promise((resolveConfirmed) => { |
| 262 | host.mountEditorReplacement( |
| 263 | new PluginRemoveConfirmComponent({ |
| 264 | id, |
| 265 | displayName, |
| 266 | onDone: (result: PluginRemoveConfirmResult) => { |
| 267 | host.restoreEditor(); |
| 268 | resolveConfirmed(result.kind === 'confirm'); |
| 269 | }, |
| 270 | }), |
| 271 | ); |
| 272 | }); |
| 273 | } |
| 274 | |
| 275 | async function confirmInstallTrust( |
| 276 | host: SlashCommandHost, |
no test coverage detected