mirror of
https://github.com/balzack/databag.git
synced 2025-04-23 18:15:19 +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 { Colors } from '../constants/Colors';
|
||||
|
||||
const ACCEPT_DELAY_MS = 100;
|
||||
|
||||
export function Ring() {
|
||||
const { state, actions } = useRing();
|
||||
const [alert, setAlert] = useState(false);
|
||||
@ -51,6 +53,7 @@ export function Ring() {
|
||||
setAccepting(callId);
|
||||
try {
|
||||
await actions.accept(callId, card);
|
||||
await new Promise((r) => setTimeout(r, ACCEPT_DELAY_MS));
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
setAlert(true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user