Interim commit for async/await
This commit is contained in:
parent
3fd340d14d
commit
fc4d1aa5f4
8 changed files with 65 additions and 37 deletions
|
|
@ -15,16 +15,17 @@ export const routes = [
|
|||
{ path: '/files', component: FileUpload },
|
||||
];
|
||||
|
||||
export default () => {
|
||||
export default async () => {
|
||||
/* Ensure that there's a slug worth trying, and that it isn't
|
||||
already a route that should be "protected"
|
||||
*/
|
||||
if (!!slug && !routes.map(
|
||||
({ path }) => path,
|
||||
).includes(window.location.pathname)) {
|
||||
CheckUrlRedirect(slug).then((url) => {
|
||||
const url = await CheckUrlRedirect(slug);
|
||||
if (url) {
|
||||
window.location.href = url;
|
||||
}).catch(() => {});
|
||||
}
|
||||
}
|
||||
|
||||
ReactDOM.render(
|
||||
|
|
|
|||
Loading…
Reference in a new issue