@@ -48,6 +57,7 @@ import { scrollToTop } from '@/scripts/scroll.js';
import { globalEvents } from '@/events.js';
import { injectPageMetadata } from '@/scripts/page-metadata.js';
import { $i, openAccountMenu as openAccountMenu_ } from '@/account.js';
+import { instance } from '@/instance.js';
const props = withDefaults(defineProps<{
tabs?: Tab[];
@@ -60,6 +70,7 @@ const props = withDefaults(defineProps<{
}[];
thin?: boolean;
displayMyAvatar?: boolean;
+ displayBackButton?: boolean;
}>(), {
tabs: () => ([] as Tab[]),
});
@@ -68,6 +79,8 @@ const emit = defineEmits<{
(ev: 'update:tab', key: string);
}>();
+const displayBackButton = props.displayBackButton && history.state.key !== 'index' && history.length > 1 && inject('shouldBackButton', true);
+
const metadata = injectPageMetadata();
const hideTitle = inject('shouldOmitHeaderTitle', false);
@@ -102,6 +115,10 @@ function onTabClick(): void {
top();
}
+function goBack(): void {
+ window.history.back();
+}
+
const calcBg = () => {
const rawBg = 'var(--bg)';
const tinyBg = tinycolor(rawBg.startsWith('var(') ? getComputedStyle(document.documentElement).getPropertyValue(rawBg.slice(4, -1)) : rawBg);
diff --git a/packages/frontend/src/pages/note.vue b/packages/frontend/src/pages/note.vue
index 9bafa17005..14f9ff3816 100644
--- a/packages/frontend/src/pages/note.vue
+++ b/packages/frontend/src/pages/note.vue
@@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only
-
+
diff --git a/packages/frontend/src/pages/page.vue b/packages/frontend/src/pages/page.vue
index 1bb65d0cef..962d910405 100644
--- a/packages/frontend/src/pages/page.vue
+++ b/packages/frontend/src/pages/page.vue
@@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only
-
+
diff --git a/packages/frontend/src/pages/user/index.vue b/packages/frontend/src/pages/user/index.vue
index dd64cc2534..df07dd9786 100644
--- a/packages/frontend/src/pages/user/index.vue
+++ b/packages/frontend/src/pages/user/index.vue
@@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only
-
+