MCPcopy
hub / github.com/QLHazyCoder/FlowPilot / deleteHotmailAccounts

Function deleteHotmailAccounts

background.js:1345–1368  ·  view source on GitHub ↗
(mode = 'all')

Source from the content-addressed store, hash-verified

1343}
1344
1345async function deleteHotmailAccounts(mode = 'all') {
1346 const state = await getState();
1347 const accounts = normalizeHotmailAccounts(state.hotmailAccounts);
1348 const targets = filterHotmailAccountsByUsage(accounts, mode);
1349 const targetIds = new Set(targets.map((account) => account.id));
1350 const nextAccounts = mode === 'used'
1351 ? accounts.filter((account) => !targetIds.has(account.id))
1352 : [];
1353
1354 await syncHotmailAccounts(nextAccounts);
1355
1356 if (state.currentHotmailAccountId && targetIds.has(state.currentHotmailAccountId)) {
1357 await setState({ currentHotmailAccountId: null });
1358 if (isHotmailProvider(state)) {
1359 await setEmailState(null);
1360 }
1361 broadcastDataUpdate({ currentHotmailAccountId: null });
1362 }
1363
1364 return {
1365 deletedCount: targets.length,
1366 remainingCount: nextAccounts.length,
1367 };
1368}
1369
1370async function patchHotmailAccount(accountId, updates = {}) {
1371 const state = await getState();

Callers 1

handleMessageFunction · 0.85

Calls 8

getStateFunction · 0.85
normalizeHotmailAccountsFunction · 0.85
syncHotmailAccountsFunction · 0.85
setStateFunction · 0.85
isHotmailProviderFunction · 0.85
setEmailStateFunction · 0.85
broadcastDataUpdateFunction · 0.85

Tested by

no test coverage detected