Interim commit for async/await

This commit is contained in:
oitsjustjose 2021-07-02 20:31:20 -05:00
commit fc4d1aa5f4
8 changed files with 65 additions and 37 deletions

View file

@ -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(