Fix profile preview jump (#1693)
* Add top inset for profile preview to match target screen * Avoid flicker by waiting for profile screen navigation * Fix glimmer to align with the content * A more reliable (but non-scientific) fix for the flash * Lower the timeout
This commit is contained in:
parent
d5ccbd76d5
commit
f447eaa669
4 changed files with 33 additions and 18 deletions
|
@ -483,9 +483,21 @@ function navigate<K extends keyof AllNavigatorParams>(
|
|||
params?: AllNavigatorParams[K],
|
||||
) {
|
||||
if (navigationRef.isReady()) {
|
||||
// @ts-ignore I dont know what would make typescript happy but I have a life -prf
|
||||
navigationRef.navigate(name, params)
|
||||
return Promise.race([
|
||||
new Promise<void>(resolve => {
|
||||
const handler = () => {
|
||||
resolve()
|
||||
navigationRef.removeListener('state', handler)
|
||||
}
|
||||
navigationRef.addListener('state', handler)
|
||||
|
||||
// @ts-ignore I dont know what would make typescript happy but I have a life -prf
|
||||
navigationRef.navigate(name, params)
|
||||
}),
|
||||
timeout(1e3),
|
||||
])
|
||||
}
|
||||
return Promise.resolve()
|
||||
}
|
||||
|
||||
function resetToTab(tabName: 'HomeTab' | 'SearchTab' | 'NotificationsTab') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue