From 25f7f8dfb44ab991afbe460d0201b4e4260fa7e7 Mon Sep 17 00:00:00 2001 From: Ruslan Bakiev Date: Sun, 22 Feb 2026 09:14:48 +0700 Subject: [PATCH] refactor: simplify telegram settings to single connect action --- frontend/app.vue | 63 ++++++------------------------------------------ 1 file changed, 7 insertions(+), 56 deletions(-) diff --git a/frontend/app.vue b/frontend/app.vue index 010d72a..52ce0c0 100644 --- a/frontend/app.vue +++ b/frontend/app.vue @@ -595,7 +595,6 @@ type TelegramConnectionSummary = { const telegramConnectStatus = ref("not_connected"); const telegramConnectStatusLoading = ref(false); const telegramConnectBusy = ref(false); -const telegramRefreshBusy = ref(false); const telegramConnectUrl = ref(""); const telegramConnections = ref([]); const telegramConnectNotice = ref(""); @@ -617,10 +616,6 @@ const telegramStatusBadgeClass = computed(() => { return "badge-ghost"; }); -const primaryTelegramBusinessConnectionId = computed( - () => telegramConnections.value.find((item) => (item.businessConnectionId ?? "").trim())?.businessConnectionId ?? "", -); - async function loadTelegramConnectStatus() { if (!authMe.value) { telegramConnectStatus.value = "not_connected"; @@ -677,27 +672,6 @@ async function startTelegramBusinessConnect() { } } -function openTelegramConnectUrl() { - if (!telegramConnectUrl.value || !process.client) return; - window.open(telegramConnectUrl.value, "_blank", "noopener,noreferrer"); -} - -async function refreshTelegramBusinessConnectionFromApi() { - const businessConnectionId = primaryTelegramBusinessConnectionId.value; - if (!businessConnectionId || telegramRefreshBusy.value) return; - - telegramRefreshBusy.value = true; - try { - await $fetch<{ ok: boolean }>("/api/omni/telegram/business/connect/refresh", { - method: "POST", - body: { businessConnectionId }, - }); - } finally { - telegramRefreshBusy.value = false; - await loadTelegramConnectStatus(); - } -} - async function completeTelegramBusinessConnectFromToken(token: string) { const t = String(token || "").trim(); if (!t) return; @@ -4069,36 +4043,13 @@ async function decideFeedCard(card: FeedCard, decision: "accepted" | "rejected") Telegram Business {{ telegramStatusLabel }} -
- - - - -
+

{{ telegramConnectNotice }}