Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
});
watch.subscribeToWatchReachability((err, watchIsReachable) => {
if (!err) {
this.setState({ watchIsReachable });
if (watchIsReachable) {
this.sendTokenToWatch();
}
}
});
watch.getWatchState((err, watchState) => {
if (!err && watchState === 'Activated') {
this.sendTokenToWatch();
}
});
watch.subscribeToWatchState((err, watchState) => {
if (!err && watchState === 'Activated') {
this.sendTokenToWatch();
}
});
};
Watch.getIsWatchAppInstalled((err, isAppInstalled) => {
if (!err) {
WatchConnectivity.shared.isAppInstalled = isAppInstalled;
Watch.subscribeToWatchState((err, watchState) => {
if (!err) {
if (watchState === 'Activated') {
WatchConnectivity.shared.sendWalletsToWatch();
}
}
});
Watch.subscribeToMessages(async (err, message, reply) => {
if (!err) {
if (message.request === 'createInvoice') {
const createInvoiceRequest = await this.handleLightningInvoiceCreateRequest(
message.walletIndex,
message.amount,
message.description,
);
reply({ invoicePaymentRequest: createInvoiceRequest });
} else if (message.message === 'sendApplicationContext') {