Cause of issue: instead of returning a promise, the useGetList returns undefined on total before changing it to a number. This is satisfying the total !== 0 condition since undefined !== 0 = True.
Description of changes:
Added a type check for number then check if it's a 0, on first load and useGetList has not returned, where total is undefined, it would not redirect back to list until total has been changed to a number.
Cause of issue: instead of returning a promise, the useGetList returns undefined on total before changing it to a number. This is satisfying the total !== 0 condition since undefined !== 0 = True. Description of changes: