Unverified Commit 6901b1f3 authored by Marius van den Beek's avatar Marius van den Beek Committed by GitHub
Browse files

Merge pull request #18286 from davelopez/24.0_fix_imported_history_link_for_anonymous

[24.0] Redirect anonymous users to home when importing public histories
parents 06237158 3c95ac03
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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
@@ -49,6 +49,7 @@
<script>
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);