in source/console/src/Common.js [14:34]
static async getAppState() {
try {
try {
const response = await API.get('PrimaryAppState', '', {});
if (!response || !response.state || response.state.trim() === ''){
throw new Error('Unable to retrieve a valid app state');
}
return response.state;
} catch (err) {
console.error(`Caught error while querying for the state in the primary region: ${err}`);
const response = await API.get('SecondaryAppState', '', {});
if (!response || !response.state || response.state.trim() === ''){
throw new Error('Unable to retrieve a valid app state');
}
return response.state;
}
} catch (err) {
console.error(`Caught error while querying for the state in the secondary region: ${err}`);
return null;
}
}