mirror of
https://github.com/balzack/databag.git
synced 2025-05-04 23:45:21 +00:00
hide ui glitch where call accepted but call status update delayed
This commit is contained in:
parent
bdb8fa99c0
commit
c44a91accd
@ -7,6 +7,8 @@ import { Text, Surface, IconButton, ActivityIndicator } from 'react-native-paper
|
|||||||
import { Confirm } from '../confirm/Confirm';
|
import { Confirm } from '../confirm/Confirm';
|
||||||
import { Colors } from '../constants/Colors';
|
import { Colors } from '../constants/Colors';
|
||||||
|
|
||||||
|
const ACCEPT_DELAY_MS = 100;
|
||||||
|
|
||||||
export function Ring() {
|
export function Ring() {
|
||||||
const { state, actions } = useRing();
|
const { state, actions } = useRing();
|
||||||
const [alert, setAlert] = useState(false);
|
const [alert, setAlert] = useState(false);
|
||||||
@ -51,6 +53,7 @@ export function Ring() {
|
|||||||
setAccepting(callId);
|
setAccepting(callId);
|
||||||
try {
|
try {
|
||||||
await actions.accept(callId, card);
|
await actions.accept(callId, card);
|
||||||
|
await new Promise((r) => setTimeout(r, ACCEPT_DELAY_MS));
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
setAlert(true);
|
setAlert(true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user