Skip to content

Follow-up: Adjust user-avatar to use `getIdFromGraphQLId` for user.id

The following discussion from !161623 (merged) should be addressed:

  • @zcuddy started a discussion:

    suggestion (non-blocking/follow-up): You noted this in the description and as this works for this scope I am not blocking here. However, I think letting user-avatar handle this makes a lot of sense.

    getIdFromGraphQLId is flexible in the sense that it will simply return the userId back if its not a gId. So in other words we can always call it in the shared component and regardless if the id is a userId or a gId it will always return the userId in the end.

    This would allow us to use a computed property in the user-avatar

    computed: {
      userId() {
        return getIdFromGraphQLId(this.user.id)
      }
    }

    WDYT about opening a follow up issue to handle this at the shared component level so we don't need to worry about it again in the future?