MCPcopy Index your code
hub / github.com/QLHazyCoder/FlowPilot / getPreferredIcloudLoginUrl

Function getPreferredIcloudLoginUrl

background.js:2812–2835  ·  view source on GitHub ↗
(error = null, state = null)

Source from the content-addressed store, hash-verified

2810}
2811
2812async function getPreferredIcloudLoginUrl(error = null, state = null) {
2813 const currentState = state || await getState();
2814 const configuredHost = getConfiguredIcloudHostPreference(currentState);
2815 if (configuredHost) {
2816 return getIcloudLoginUrlForHost(configuredHost);
2817 }
2818
2819 const messageHint = getIcloudHostHintFromMessage(getErrorMessage(error));
2820 if (messageHint) {
2821 return getIcloudLoginUrlForHost(messageHint);
2822 }
2823
2824 const savedHost = normalizeIcloudHost(currentState?.preferredIcloudHost);
2825 if (savedHost) {
2826 return getIcloudLoginUrlForHost(savedHost);
2827 }
2828
2829 const openHost = await getOpenIcloudHostPreference();
2830 if (openHost) {
2831 return getIcloudLoginUrlForHost(openHost);
2832 }
2833
2834 return ICLOUD_LOGIN_URLS[0];
2835}
2836
2837async function getPreferredIcloudSetupUrls(state = null, error = null) {
2838 const preferredLoginUrl = await getPreferredIcloudLoginUrl(error, state);

Callers 2

promptIcloudLoginFunction · 0.85

Calls 7

getStateFunction · 0.85
getIcloudLoginUrlForHostFunction · 0.85
normalizeIcloudHostFunction · 0.85
getErrorMessageFunction · 0.70

Tested by

no test coverage detected