Unverified Commit 56429d43 authored by David López's avatar David López Committed by GitHub
Browse files

Merge pull request #14189 from jmchilton/fix_anonymous_tool_favorites

[22.05] Fix logic around tool favorites for anonymous users.
parents d95752f7 4e17c5f0
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@
                        <span class="fa fa-star-o" />
                    </b-button>
                    <b-button
                        v-else
                        v-else-if="showRemoveFavorite"
                        v-b-tooltip.hover
                        role="button"
                        title="Remove from Favorites"
@@ -176,8 +176,14 @@ export default {
        versions() {
            return this.options.versions;
        },
        hasUser() {
            return !this.user.isAnonymous;
        },
        showAddFavorite() {
            return !!this.user.email && !this.isFavorite;
            return this.hasUser && !this.isFavorite;
        },
        showRemoveFavorite() {
            return this.hasUser && !this.showAddFavorite;
        },
        showVersions() {
            return this.versions && this.versions.length > 1;