MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / refreshAccountsView

Function refreshAccountsView

static/js/accounts.js:192–223  ·  view source on GitHub ↗
(options = {})

Source from the content-addressed store, hash-verified

190}
191
192async function refreshAccountsView(options = {}) {
193 const refreshStats = options.refreshStats !== false;
194 const refreshList = options.refreshList !== false;
195 const settleDelayMs = Math.max(0, Number(options.settleDelayMs || 0));
196 const tasks = [];
197
198 if (settleDelayMs > 0) {
199 await delay(settleDelayMs);
200 }
201
202 if (refreshStats) {
203 if (!pendingAccountStatsRefresh) {
204 pendingAccountStatsRefresh = loadStats().finally(() => {
205 pendingAccountStatsRefresh = null;
206 });
207 }
208 tasks.push(pendingAccountStatsRefresh);
209 }
210
211 if (refreshList) {
212 if (!pendingAccountListRefresh) {
213 pendingAccountListRefresh = loadAccounts().finally(() => {
214 pendingAccountListRefresh = null;
215 });
216 }
217 tasks.push(pendingAccountListRefresh);
218 }
219
220 if (tasks.length > 0) {
221 await Promise.all(tasks);
222 }
223}
224
225// DOM 元素
226const elements = {

Callers 5

validateTokenFunction · 0.85
runBatchRefreshTaskFunction · 0.85
runBatchValidateTaskFunction · 0.85
runOverviewRefreshTaskFunction · 0.85

Calls 4

delayFunction · 0.85
allMethod · 0.80
loadStatsFunction · 0.70
loadAccountsFunction · 0.70

Tested by

no test coverage detected