I have an error that happens infrequently. After using my website where I fetch data from IPFS for a while and I refresh the page the fetch that’s initiated will stall and never retrieve the data and won’t retrieve the data no matter how many times I refresh unless I close out of the browser and relaunch it.
I can’t see any issue with the way your are instantiating the ipfs client. Your issue with the fetch after refreshing the page could be caused by any number of things. If you have a github repo and detailed steps to duplicate your environment then someone would be able to better help you.