Cancel notifications on unmount in AddKey screen to avoid showing notifications once the screen is closed. We somehow missed this in AddKey screen.
Changed following hooks:
useTimeout:
Created custom hook for it useTimeout() which basically cancels all timeouts on unmount without main component having to deal with it. We need it because in CloneRepo screen we show animations and notification with timeouts. So, if we user exists early we can cancel those timeouts thereby not allowing callback code inside timeout to run resulting into delayed notification on another screen.
useLottieAnimtion:
Apart from cancelling timeouts we also need to make sure we stop lottie animations using anim.stop() method. We weren't handling it resulting into memory leak.
Added animation stop and clean up logic in useLottieAnimation hook by exposing additional method from this hook called stopAnimation. So, now this hook returns tuple with actual animation instance and stopAnimation method to stop that particular animation. Ideally we could have used animation instance and called stop() method on it but that doesn't seems to work maybe animation instance becomes null when associated container of it is unmounted and no longer present in DOM.
That is the reason we're providing another method from this hook.
Remove "Open Profile" menu action.
Shitty workaround for aligning images in ProviderAccordian component.
AddKey
screen to avoid showing notifications once the screen is closed. We somehow missed this in AddKey screen. Changed following hooks:useTimeout:
useLottieAnimtion:
ProviderAccordian
component.