mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 19:16:41 +07:00
loader: error handling
This commit is contained in:
parent
71a0aed9aa
commit
1c014ec9fb
5 changed files with 102 additions and 12 deletions
|
@ -11,7 +11,7 @@ export const checkUserToken = ({ id, token }) => axios.get(API.CHECK_TOKEN, {
|
|||
id,
|
||||
token,
|
||||
routes: (result.data.routes && result.data.routes.length > 0 && arrayToObject(result.data.routes, '_id')) || {},
|
||||
}));
|
||||
})).catch(() => null);
|
||||
|
||||
export const getGuestToken = () => axios.get(API.GET_GUEST).then(result => (result && result.data));
|
||||
|
||||
|
|
|
@ -26,3 +26,11 @@ export const parseQuery = (queryString: string) => {
|
|||
}
|
||||
return params;
|
||||
};
|
||||
|
||||
export const pushLoaderState = state => {
|
||||
document.getElementById('loader-bar').style.width = `${state}%`;
|
||||
};
|
||||
|
||||
export const pushNetworkInitError = state => {
|
||||
document.getElementById('loader-error').style.opacity = 1;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue