go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
44.39k stars 5.43k forks source link

As a new user, the heatmap does not render until you have submitted the first commit. #5151

Closed tonysgi closed 5 years ago

tonysgi commented 5 years ago

Description

As a new user, the heatmap does not render until you have submitted the first commit. Until that happens, it is perpetually displaying the "heatmap.loading" icon.

Screenshots

image

Originally posted by @tonysgi in https://github.com/go-gitea/gitea/pull/5131#issuecomment-432329383

kolaente commented 5 years ago

Normally it shouldn't show "heatmap.loading", there should be a text.

I think it doesn't load because the API returns null if the user has no actions yet, which the js library then fails to parse. I'll submit a patch tomorrow

sapk commented 5 years ago

@kolaente I already proposed a fix. You are right, it is because the array is not init (in the api reply) and the json representation is null not [].

kolaente commented 5 years ago

@sapk Great! Thanks!