Fix: stepType was being set to an object

This commit is contained in:
Jose Olarte III
2025-07-07 16:20:11 +08:00
parent ba15b500c4
commit 41dab36eb6
3 changed files with 33 additions and 14 deletions

View File

@@ -144,11 +144,14 @@ export default class EntitySelectionStep extends Vue {
get stepLabel(): string {
if (this.stepType === "recipient") {
return "Choose who received the gift:";
} else if (this.showProjects) {
return "Choose a project benefitted from:";
} else {
return "Choose a person received from:";
} else if (this.stepType === "giver") {
if (this.shouldShowProjects) {
return "Choose a project benefitted from:";
} else {
return "Choose a person received from:";
}
}
return "Choose entity:";
}
/**
@@ -166,10 +169,13 @@ export default class EntitySelectionStep extends Vue {
* Whether to show projects in the grid
*/
get shouldShowProjects(): boolean {
return (
(this.stepType === "giver" && this.giverEntityType === "project") ||
(this.stepType === "recipient" && this.recipientEntityType === "project")
);
// When editing an entity, show the appropriate entity type for that entity
if (this.stepType === "giver") {
return this.giverEntityType === "project";
} else if (this.stepType === "recipient") {
return this.recipientEntityType === "project";
}
return false;
}
/**