FIX: Only send complication updates if watch is reachable

This commit is contained in:
marcospr 2021-02-22 22:28:45 -05:00
parent 563162c8b1
commit e722e43d95

View file

@ -28,7 +28,7 @@ function WatchConnectivity() {
}, [walletsInitialized, wallets, preferredFiatCurrency, isReachable, isInstalled]);
useEffect(() => {
if (walletsInitialized && preferredFiatCurrency) {
if (isInstalled && isReachable && walletsInitialized && preferredFiatCurrency) {
try {
transferCurrentComplicationUserInfo({
preferredFiatCurrency: JSON.parse(preferredFiatCurrency).endPointKey,
@ -38,8 +38,7 @@ function WatchConnectivity() {
console.log(e);
}
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [preferredFiatCurrency, walletsInitialized]);
}, [preferredFiatCurrency, walletsInitialized, isReachable, isInstalled]);
const handleMessages = (message, reply) => {
if (message.request === 'createInvoice') {