diff --git a/dashboard/src/components/app/Uninstall.vue b/dashboard/src/components/app/Uninstall.vue index df95d42c1..72495f520 100644 --- a/dashboard/src/components/app/Uninstall.vue +++ b/dashboard/src/components/app/Uninstall.vue @@ -18,42 +18,6 @@ const props = defineProps([ 'app' ]); const latestBackup = ref(null); -const TARGET_RUN_STATE = { - START: Symbol('start'), - STOP: Symbol('stop'), -}; - -function targetRunState() { - const app = props.app; - - // if we have an error, we want to retry the pending state, otherwise toggle the runstate - if (app.error) { - if (app.error.details.installationState === ISTATES.PENDING_START) return TARGET_RUN_STATE.START; - else return TARGET_RUN_STATE.STOP; - } else { - if (app.runState === RSTATES.STOPPED) return TARGET_RUN_STATE.START; - else return TARGET_RUN_STATE.STOP; - } -} - -const toggleRunStateBusy = ref(false); -async function onToggleRunState() { - const app = props.app; - - toggleRunStateBusy.value = true; - - let error; - if (targetRunState() === TARGET_RUN_STATE.START) [error] = await appsModel.start(app.id); - else [error] = await appsModel.stop(app.id); - - if (error) { - toggleRunStateBusy.value = false; - console.error(error); - } else { - setTimeout(() => toggleRunStateBusy.value = false, 3000); - } -} - async function onUninstall() { const yes = await inputDialog.value.confirm({ title: t('app.uninstallDialog.title', { app: (props.app.label || props.app.fqdn) }), @@ -111,20 +75,6 @@ onMounted(async () => {