mirror of
https://github.com/koloml/furbooru-tagging-assistant.git
synced 2025-12-24 07:12:57 +00:00
Implemented routing to be more compatible for extension popup
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
import "../styles/popup.scss";
|
||||
import Header from "$components/layout/Header.svelte";
|
||||
import Footer from "$components/layout/Footer.svelte";
|
||||
import { initializeLinksReplacement } from "$lib/popup-links";
|
||||
import { onDestroy } from "svelte";
|
||||
|
||||
interface Props {
|
||||
children?: import('svelte').Snippet;
|
||||
@@ -12,6 +14,12 @@
|
||||
// Sort of a hack, detect if we rendered in the browser tab or in the popup.
|
||||
// Popup will always should have fixed 320px size, otherwise we consider it opened in the tab.
|
||||
document.body.classList.toggle('is-in-tab', window.innerWidth > 320);
|
||||
|
||||
const disconnectLinkReplacement = initializeLinksReplacement();
|
||||
|
||||
onDestroy(() => {
|
||||
disconnectLinkReplacement();
|
||||
})
|
||||
</script>
|
||||
|
||||
<Header/>
|
||||
|
||||
Reference in New Issue
Block a user