(deleteDataDir: boolean)
| 1554 | // isBuiltin), but TS can't track that across viewState transitions. |
| 1555 | if (!pluginScope_2 || pluginScope_2 === 'builtin' || !isInstallableScope(pluginScope_2)) return; |
| 1556 | const doUninstall = async (deleteDataDir: boolean) => { |
| 1557 | setIsProcessing(true); |
| 1558 | setProcessError(null); |
| 1559 | try { |
| 1560 | const result_3 = await uninstallPluginOp(pluginId_9, pluginScope_2, deleteDataDir); |
| 1561 | if (!result_3.success) throw new Error(result_3.message); |
| 1562 | clearAllCaches(); |
| 1563 | const suffix = deleteDataDir ? '' : ' · data preserved'; |
| 1564 | setResult(`${figures.tick} ${result_3.message}${suffix}`); |
| 1565 | if (onManageComplete) void onManageComplete(); |
| 1566 | setParentViewState({ |
| 1567 | type: 'menu' |
| 1568 | }); |
| 1569 | } catch (e_0) { |
| 1570 | setIsProcessing(false); |
| 1571 | setProcessError(e_0 instanceof Error ? e_0.message : String(e_0)); |
| 1572 | } |
| 1573 | }; |
| 1574 | if (input === 'y' || input === 'Y') { |
| 1575 | void doUninstall(true); |
| 1576 | } else if (input === 'n' || input === 'N') { |
no test coverage detected