()
| 135 | * 根据当前连接状态更新按钮外观 |
| 136 | */ |
| 137 | export function updateChatAppsButton() { |
| 138 | if (!openBtn) return; |
| 139 | const config = state.config; |
| 140 | const adapters = config?.adapters || {}; |
| 141 | const hasAnyToken = hasConfiguredChatApp(adapters); |
| 142 | |
| 143 | if (hasAnyToken) { |
| 144 | openBtn.classList.add("connected"); |
| 145 | openBtn.querySelector(".action-btn-label").textContent = "Connected to Chat Apps"; |
| 146 | } else { |
| 147 | openBtn.classList.remove("connected"); |
| 148 | openBtn.querySelector(".action-btn-label").textContent = "Connect Chat Apps"; |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | // --- Internal Helpers --- |
| 153 |
no test coverage detected