From 3c95ac03e6d15f5a4046d8e7eeb082ec0b03c572 Mon Sep 17 00:00:00 2001
From: davelopez <46503462+davelopez@users.noreply.github.com>
Date: Fri, 31 May 2024 15:27:28 +0200
Subject: [PATCH] Redirect anonymous users to home when importing public
histories
---
client/src/components/History/HistoryView.vue | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/client/src/components/History/HistoryView.vue b/client/src/components/History/HistoryView.vue
index e185e7517147..a21c0ba9744c 100644
--- a/client/src/components/History/HistoryView.vue
+++ b/client/src/components/History/HistoryView.vue
@@ -26,7 +26,7 @@
- History imported and is now your active history. View here.
+ History imported and is now your active history. View here.
import { mapActions, mapState } from "pinia";
+import { isAnonymousUser } from "@/api";
import { useHistoryStore } from "@/stores/historyStore";
import { useUserStore } from "@/stores/userStore";
@@ -123,6 +124,9 @@ export default {
canImportHistory() {
return !this.userOwnsHistory && !this.history.purged;
},
+ importedHistoryLink() {
+ return isAnonymousUser(this.currentUser) ? "/" : "/histories/list";
+ },
},
created() {
this.loadHistoryById(this.id);