Skip to content

Commit

Permalink
Merge pull request #16741 from ahmedhamidawan/import_history_same_name
Browse files Browse the repository at this point in the history
[23.1] Allow importing history with same name as original history
  • Loading branch information
dannon authored Oct 4, 2023
2 parents bb8d4b0 + 054be47 commit 84f08b2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions client/src/components/History/Modals/CopyModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default {
};
},
computed: {
...mapState(useUserStore, ["isAnonymous"]),
...mapState(useUserStore, ["currentUser", "isAnonymous"]),
title() {
return `Copying History: ${this.history.name}`;
},
Expand All @@ -71,9 +71,12 @@ export default {
saveVariant() {
return this.loading ? "info" : this.formValid ? "primary" : "secondary";
},
userOwnsHistory() {
return this.currentUser.id == this.history.user_id;
},
newNameValid() {
if (this.name == this.history.name) {
return null;
if (this.userOwnsHistory && this.name == this.history.name) {
return false;
}
return this.name.length > 0;
},
Expand Down

0 comments on commit 84f08b2

Please sign in to comment.