Skip to content

πŸ“š The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.

Fix MediumView isMobile()

Smaug67398452f23d0c16
diff --git a/frontend/components/MediumView.vue b/frontend/components/MediumView.vue
index 153c8029..952df378 100644
--- a/frontend/components/MediumView.vue
+++ b/frontend/components/MediumView.vue
@@ -1,34 +1,33 @@
<template>
- <main class="medium-view" ref="mediumContainer" :style="{ marginLeft, transition }">
- <slot></slot>
- </main>
+ <main class="medium-view" ref="mediumContainer" :style="{ marginLeft, transition }">
+ <slot></slot>
+ </main>
</template>
<script setup lang="ts">
const { isOpened, paneWidth, isResizing } = useSidebar();
const mediumContainer = ref<HTMLElement | null>(null);
-const isMobile = () => process.client ? window.innerWidth <= 768 : false;
-const marginLeft = computed(() => (isMobile() || !isOpened.value) ? '0' : `${paneWidth.value}px`);
-const transition = computed(() => isResizing.value ? 'none' : 'margin-left 0.3s');
+const marginLeft = computed(() => (isMobile() || !isOpened.value ? '0' : `${paneWidth.value}px`));
+const transition = computed(() => (isResizing.value ? 'none' : 'margin-left 0.3s'));
</script>
<style scoped>
.medium-view {
- padding: 0 2rem;
- width: 100%;
- height: 100%;
+ padding: 0 2rem;
+ width: 100%;
+ height: 100%;
}
@media print {
- .medium-view {
- padding: 0 !important;
- margin: 0 !important;
- }
+ .medium-view {
+ padding: 0 !important;
+ margin: 0 !important;
+ }
}
@media screen and (max-width: 719px) {
- .medium-view {
- padding: 0 0.5rem;
- }
+ .medium-view {
+ padding: 0 0.5rem;
+ }
}
-</style>
\ No newline at end of file
+</style>