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

Function patchHotmailAccount

background.js:1370–1395  ·  view source on GitHub ↗
(accountId, updates = {})

Source from the content-addressed store, hash-verified

1368}
1369
1370async function patchHotmailAccount(accountId, updates = {}) {
1371 const state = await getState();
1372 const accounts = normalizeHotmailAccounts(state.hotmailAccounts);
1373 const account = findHotmailAccount(accounts, accountId);
1374 if (!account) {
1375 throw new Error('未找到对应的 Hotmail 账号。');
1376 }
1377
1378 const nextAccount = normalizeHotmailAccount({
1379 ...account,
1380 ...updates,
1381 id: account.id,
1382 });
1383
1384 await syncHotmailAccounts(accounts.map((item) => (item.id === account.id ? nextAccount : item)));
1385
1386 if (state.currentHotmailAccountId === account.id && shouldClearHotmailCurrentSelection(nextAccount)) {
1387 await setState({ currentHotmailAccountId: null });
1388 broadcastDataUpdate({ currentHotmailAccountId: null });
1389 if (isHotmailProvider(state)) {
1390 await setEmailState(null);
1391 }
1392 }
1393
1394 return nextAccount;
1395}
1396
1397async function setCurrentHotmailAccount(accountId, options = {}) {
1398 const { markUsed = false, syncEmail = true } = options;

Callers 3

handleStepDataFunction · 0.85
handleStepDataFunction · 0.85
handleMessageFunction · 0.85

Calls 10

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

Tested by

no test coverage detected