Skip to content

Commit

Permalink
gh pages 404 redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
aotearoan committed Jun 28, 2020
1 parent 188bff0 commit 2720ca0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@aotearoan/neon",
"description": "Neon is a design library of components for use with VueJS. It supports light and dark modes and can be extended to support multiple themes",
"version": "0.18.7",
"version": "0.18.8",
"main": "dist/@aotearoan/neon.umd.js",
"types": "dist/@aotearoan/components.d.ts",
"files": [
Expand Down
5 changes: 5 additions & 0 deletions public/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<script>
const path = window.location.pathname.slice(1);
localStorage.setItem('path', path);
window.location.href='../';
</script>
6 changes: 6 additions & 0 deletions src/app/App.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ export default class App extends Vue {
private isMobile = false;

public mounted() {
const path = localStorage.getItem('path');
if (path) {
localStorage.removeItem('path');
this.$router.push({ path });
}

NeonModeUtils.init();
NeonModeUtils.addListener('app-mode-listener', this.switchMode);
window.addEventListener('resize', this.handleResize);
Expand Down
2 changes: 1 addition & 1 deletion src/app/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const routes: Array<RouteConfig> = [
];

const router = new VueRouter({
mode: 'history',
mode: process.env.NODE_ENV === 'production' ? undefined : 'history',
base: process.env.VUE_APP_BASE_URL,
routes,
});
Expand Down

0 comments on commit 2720ca0

Please sign in to comment.