diff --git a/app/mobile/src/context/useStoreContext.hook.js b/app/mobile/src/context/useStoreContext.hook.js index 78f90cb1..79802e73 100644 --- a/app/mobile/src/context/useStoreContext.hook.js +++ b/app/mobile/src/context/useStoreContext.hook.js @@ -1,7 +1,7 @@ import { useEffect, useState, useRef, useContext } from 'react'; import SQLite from "react-native-sqlite-storage"; -const DATABAG_DB = 'databag_v039.db'; +const DATABAG_DB = 'databag_v040.db'; export function useStoreContext() { const [state, setState] = useState({}); diff --git a/app/mobile/src/session/contact/Contact.jsx b/app/mobile/src/session/contact/Contact.jsx index 74704d06..872b7d27 100644 --- a/app/mobile/src/session/contact/Contact.jsx +++ b/app/mobile/src/session/contact/Contact.jsx @@ -66,10 +66,18 @@ export function Contact({ contact, closeContact }) { const saveAndConnect = () => { setContact(actions.saveAndConnect); } + + const confirmAndConnect = () => { + setContact(actions.confirmAndConnect); + } const saveContact = () => { setContact(actions.saveContact); } + + const confirmContact = () => { + setContact(actions.confirmContact); + } const ignoreContact = () => { setContact(actions.ignoreContact); @@ -186,10 +194,10 @@ export function Contact({ contact, closeContact }) { )} { state.status === 'pending' && ( <> - + Save and Connect - + Save Contact diff --git a/app/mobile/src/session/contact/useContact.hook.js b/app/mobile/src/session/contact/useContact.hook.js index 44a4342f..3be55fb6 100644 --- a/app/mobile/src/session/contact/useContact.hook.js +++ b/app/mobile/src/session/contact/useContact.hook.js @@ -101,6 +101,17 @@ export function useContact(contact, close) { } }); }, + confirmAndConnect: async () => { + await applyAction(async () => { + await card.actions.setCardConfirmed(state.cardId); + await card.actions.setCardConnecting(state.cardId); + let open = await card.actions.getCardOpenMessage(state.cardId); + let contact = await card.actions.setCardOpenMessage(state.node, open); + if (contact.status === 'connected') { + await card.actions.setCardConnected(state.cardId, contact.token, contact); + } + }); + }, saveContact: async () => { await applyAction(async () => { let message = await getListingMessage(state.node, state.guid); @@ -119,6 +130,11 @@ export function useContact(contact, close) { } }); }, + confirmContact: async () => { + await applyAction(async () => { + await card.actions.setCardConfirmed(state.cardId); + }); + }, ignoreContact: async () => { await applyAction(async () => { await card.actions.setCardConfirmed(state.cardId);