mirror of
https://github.com/danog/telegram-tt.git
synced 2025-01-21 21:01:29 +01:00
Fix frozen layout when proload task fails
This commit is contained in:
parent
6dd0249541
commit
5eb2e77c2e
@ -92,9 +92,17 @@ const UiLoader: FC<OwnProps & StateProps & DispatchProps> = ({
|
||||
useEffect(() => {
|
||||
let timeout: number | undefined;
|
||||
|
||||
const safePreload = async () => {
|
||||
try {
|
||||
await preloadTasks[page]();
|
||||
} catch (err) {
|
||||
// Do nothing
|
||||
}
|
||||
};
|
||||
|
||||
Promise.race([
|
||||
pause(MAX_PRELOAD_DELAY),
|
||||
preloadTasks[page](),
|
||||
safePreload(),
|
||||
]).then(() => {
|
||||
markReady();
|
||||
setIsUiReady({ uiReadyState: 1 });
|
||||
|
Loading…
x
Reference in New Issue
Block a user