[#74867650] Extract loading animation to a function

This extracts the loading animation into another function because this functionality is also used by the update button