Skip to content

Commit

Permalink
Merge pull request #18286 from davelopez/24.0_fix_imported_history_li…
Browse files Browse the repository at this point in the history
…nk_for_anonymous

[24.0] Redirect anonymous users to home when importing public histories
  • Loading branch information
mvdbeek authored May 31, 2024
2 parents 0623715 + 3c95ac0 commit 6901b1f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client/src/components/History/HistoryView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</div>

<b-alert :show="copySuccess">
History imported and is now your active history. <b-link to="/histories/list">View here</b-link>.
History imported and is now your active history. <b-link :to="importedHistoryLink">View here</b-link>.
</b-alert>

<CollectionPanel
Expand All @@ -49,6 +49,7 @@
<script>
import { mapActions, mapState } from "pinia";
import { isAnonymousUser } from "@/api";
import { useHistoryStore } from "@/stores/historyStore";
import { useUserStore } from "@/stores/userStore";
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 6901b1f

Please sign in to comment.