Show current user in ContactGiftingView
#155
Open
jose
wants to merge 8 commits from contact-gifting-current-user
into master
pull from: contact-gifting-current-user
merge into: trent_larson:master
trent_larson:ai-context
trent_larson:android-15-check
trent_larson:app_id_fix
trent_larson:ask-for-contacts-export
trent_larson:build-dev-to-dist
trent_larson:build-improvement
trent_larson:build-ios
trent_larson:build-with-env
trent_larson:capacitor-local-save
trent_larson:claim-view-error-handling
trent_larson:claimview-fullfills-offer
trent_larson:contacts-view-fixes
trent_larson:cross-platform-factory
trent_larson:cross-platform-factory-redux
trent_larson:d9085ced6df7dc7bdcd899959cea6489cab7f8b8
trent_larson:db-backup-cross-platform
trent_larson:deep-link
trent_larson:deep-links-android-update
trent_larson:deep_linking
trent_larson:design-tweaks-2023-12
trent_larson:electron_fix_20250317
trent_larson:experimental_plugin
trent_larson:eye-slash
trent_larson:fix-contact-import-export
trent_larson:fix-service-worker
trent_larson:friend-tech-inspired-pwa-dialog
trent_larson:get-get-hash
trent_larson:gifting-periphery-improvements
trent_larson:gifting-ui-2025-05
trent_larson:home-icon-enhancements
trent_larson:home-view-notification-improvements
trent_larson:homeview-cleanup-2025-03
trent_larson:homeview-refresh-2025-02
trent_larson:imagemagick-anrdoid
trent_larson:ios-contact-copy
trent_larson:logger-level
trent_larson:logging-upgrade
trent_larson:main
trent_larson:master
trent_larson:master-settings-upgrade
trent_larson:matthew-scratch-2025-06-28
trent_larson:migrate-dexie-to-sqlite
trent_larson:nearby-filter
trent_larson:new-storage
trent_larson:nostr
trent_larson:notification-line-wrapping
trent_larson:notification-request-permission-dialog
trent_larson:notification-section
trent_larson:notify-time
trent_larson:offer-edit
trent_larson:offer-validation-logic
trent_larson:onboarding-dialog-fix
trent_larson:passkey
trent_larson:passkey-cache
trent_larson:performance-optimizations-testing
trent_larson:photo-reverse
trent_larson:plan-loc
trent_larson:platformservicemixin-interface-consolidation
trent_larson:playwright-pwa-install-test
trent_larson:playwright-test-60-fix
trent_larson:playwright-test-updates
trent_larson:profile-pic
trent_larson:project-gives
trent_larson:qrcode-capacitor
trent_larson:registration-gate
trent_larson:remove-image-cache
trent_larson:replace-iconrenderer
trent_larson:script-build-mode
trent_larson:search-map-fix
trent_larson:side_step
trent_larson:simple-signer
trent_larson:split_build_process
trent_larson:sql-absurd-sql
trent_larson:sql-absurd-sql-further
trent_larson:sql-wa-sqlite
trent_larson:star-projects
trent_larson:starred-projects
trent_larson:streamline-attempt
trent_larson:sw-cleanup
trent_larson:tmp
trent_larson:trent-tweaks
trent_larson:tweaks
trent_larson:ui-fixes-2024-03
trent_larson:ui-fixes-2025-03
trent_larson:ui-fixes-2025-06-w2
trent_larson:units-mocking
trent_larson:v-onboarding-2024-04
trent_larson:vite-version
trent_larson:web-serve-fix
trent_larson:web-tests
Reviewers
Request review
No reviewers
Labels
Apply labels
Clear labels
No items
No Label
Milestone
Set milestone
Clear milestone
No items
No Milestone
Assignees
Assign users
Clear assignees
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.
No due date set.
Dependencies
This pull request currently doesn't have any dependencies.
Reference in new issue
There is no content yet.
Delete Branch 'contact-gifting-current-user'
Deleting a branch is permanent. It CANNOT be undone. Continue?
No
Yes
Show current user in ContactGiftingViewto WIP: Show current user in ContactGiftingView 6 days agoWIP: Show current user in ContactGiftingViewto Show current user in ContactGiftingView 5 days ago* Creates an entity object from the contact parameter
*/
private createEntityFromContact(
contact?: GiverReceiverInputInfo | "Unnamed" | "You",
Let's change this logic a little bit, because there are redundant potential states:
The "contact" could be null/undefined. That is the case where "Unnamed" would be used, so we don't need a separate "Unnamed" value. (If we have both potential cases then we have to include similar logic to work with both cases, which makes it more complex.)
The contact could be the current user's activeDid, so that's what we should use in the openDialog instead of the word "You". (We should be checking here for the activeDid... and if we also have to check "You" then there is duplicate logic again... again adding to the complexity and difficulty of maintenance.)
I refactored the entity creation method by eliminating the use of string-type entities, and instead determining those through the logic you mentioned. No more "Unnamed" or "You" special cases, just deduction via DID.
I also looked at related views and components to find similar patterns and refactored those, as well.