forked from trent_larson/crowd-funder-for-time-pwa
Refactor: improve dialog logic and entity handling
- Split openDialog into separate methods to improve code readability and maintainability through method extraction - Add receiver name fallback in GiftedDialog when receiver exists but has no name - Enhance shouldShowYouEntity to prevent selecting "You" as both giver and recipient - Improve labeling of "(No name)" entities while retaining original entity object properties - Apply special styling to "Unnamed" and "(No Name)" entities
This commit is contained in:
@@ -226,14 +226,7 @@ export default class GiftedDialog extends Vue {
|
||||
|
||||
this.allMyDids = await retrieveAccountDids();
|
||||
|
||||
if (this.giver && !this.giver.name) {
|
||||
this.giver.name = didInfo(
|
||||
this.giver.did,
|
||||
this.activeDid,
|
||||
this.allMyDids,
|
||||
this.allContacts,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if (
|
||||
this.giverEntityType === "project" ||
|
||||
@@ -457,7 +450,7 @@ export default class GiftedDialog extends Vue {
|
||||
if (contact) {
|
||||
this.giver = {
|
||||
did: contact.did,
|
||||
name: contact.name || contact.did,
|
||||
name: contact.name,
|
||||
};
|
||||
} else {
|
||||
// Only set to "Unnamed" if no giver is currently set
|
||||
@@ -519,7 +512,7 @@ export default class GiftedDialog extends Vue {
|
||||
if (contact) {
|
||||
this.receiver = {
|
||||
did: contact.did,
|
||||
name: contact.name || contact.did,
|
||||
name: contact.name,
|
||||
};
|
||||
} else {
|
||||
// Only set to "Unnamed" if no receiver is currently set
|
||||
|
||||
Reference in New Issue
Block a user