Skip to content

Commit

Permalink
fixup! Show a warning notification on fetch token error when starting…
Browse files Browse the repository at this point in the history
… a workspace
  • Loading branch information
vinokurig committed Sep 12, 2024
1 parent ce6e32e commit e7fe0bf
Showing 1 changed file with 9 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -318,25 +318,18 @@ export const actionCreators: ActionCreators = {
const attributes = e.response.data.attributes;
let message = e.response.data.message;
let provider = '';
let statusUrl = '';
if (attributes !== undefined && attributes.provider !== undefined) {
switch (attributes.provider) {
case 'github':
provider = 'GitHub';
statusUrl = 'https://www.githubstatus.com';
break;
case 'gitlab':
provider = 'Gitlab';
statusUrl = 'https://status.gitlab.com';
break;
case 'bitbucket':
provider = 'Bitbucket';
statusUrl = 'https://bitbucket.status.atlassian.com';
break;
const providerAttribute: string = attributes.provider;
if (providerAttribute.startsWith('github')) {
provider = 'GitHub';
} else if (providerAttribute.startsWith('gitlab')) {
provider = 'Gitlab';
} else if (providerAttribute.startsWith('bitbucket')) {
provider = 'Bitbucket';
}
}
if (provider.length > 0 && statusUrl.length > 0) {
message = `${provider} might be unavailable, please check ${statusUrl}`;
if (provider.length > 0) {
message = `${provider} might not be operational, please check the provider's status page.`;
}
dispatch({
type: Type.UPDATE_WARNING,
Expand Down

0 comments on commit e7fe0bf

Please sign in to comment.