Skip to content

Commit

Permalink
revert: deep linking in router file
Browse files Browse the repository at this point in the history
  • Loading branch information
Nomalah committed Oct 9, 2024
1 parent bd66623 commit 89944db
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { createApp } from "vue";
import { createPinia } from "pinia";
import { App, URLOpenListenerEvent } from '@capacitor/app';

import VueApp from "./App.vue";
import App from "./App.vue";
import router from "./router";

import { defineCustomElements } from "@ionic/pwa-elements/loader";
Expand All @@ -13,24 +12,11 @@ import "@/assets/css/globals.css";
import "@/assets/css/fonts.css";
import "@/scripts/dark_mode";

const app = createApp(VueApp);
const app = createApp(App);

app.use(createPinia());
app.use(router);

App.addListener('appUrlOpen', function (event: URLOpenListenerEvent) {
// Example url: https://acchymns.app/HSZ/2
// slug = /tabs/tabs2
const slug = event.url.split('.app').pop();

// We only push to the route if there is a slug present
if (slug) {
router.push({
path: slug,
});
}
});

// set webview settings
setBackForwardNavigationGestures(true);

Expand Down

0 comments on commit 89944db

Please sign in to comment.