Skip to content

Avatars are not loading on the Home scene for certain locales #43

Discussion options

You must be logged in to vote

After some digging, it appears that this issue is connected to how we retrieve the value for authorUserId. It's not directly returned from Discourse, but from our own endpoint.

t.nullable.int('authorUserId', {
   resolve: ({ posters }) => {
      const author = posters.find((p: Poster) =>
         p.description.toLowerCase().includes('original poster'),
      );

      return author?.userId || author?.user?.id || null;
   },
});

As you can see from the code snippet above, we determine the author by checking the user's description if it includes the phrase 'original poster'. Because the phrase is in English, it didn't match the user's description on your site which uses Chinese, resulting …

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@Bardreamaster
Comment options

Comment options

You must be logged in to vote
5 replies
@Bardreamaster
Comment options

@gabriellaputri
Comment options

Answer selected by Bardreamaster
@Bardreamaster
Comment options

@Bardreamaster
Comment options

@jovitazhang
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered counterpart to the question label indicating that the question has been answered
3 participants