fix: ensure consistent "Recently Added" contacts in ProjectRepresentativeDialog

EntityGrid's recentContacts assumes contacts are sorted by date added
(newest first), but ProjectRepresentativeDialog was receiving contacts
sorted alphabetically from NewEditProjectView, causing it to show
different "Recently Added" contacts than GiftedDialog.

- Changed NewEditProjectView to use $contactsByDateAdded() instead of
  $getAllContacts()
- Added documentation comments to EntityGrid.vue to prevent this issue
  in future reuses
This commit is contained in:
Jose Olarte III
2025-11-11 15:06:07 +08:00
parent 9a3409c29f
commit 2530bc0ec2
2 changed files with 17 additions and 3 deletions

View File

@@ -461,9 +461,9 @@ export default class NewEditProjectView extends Vue {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
this.allMyDids = await (this as any).$getAllAccountDids();
// Load contacts
// Load contacts sorted by date added (newest first) for consistent "Recently Added" display
// eslint-disable-next-line @typescript-eslint/no-explicit-any
this.allContacts = await (this as any).$getAllContacts();
this.allContacts = await (this as any).$contactsByDateAdded();
this.apiServer = settings.apiServer || "";
this.showGeneralAdvanced = !!settings.showGeneralAdvanced;