FIX: Don't show clipboard modal if user has already acted on it

This commit is contained in:
marcosrdz 2020-12-19 03:39:07 -05:00
parent 5588ad1eb2
commit 27301965b7

6
App.js
View File

@ -43,7 +43,7 @@ const App = () => {
const appState = useRef(AppState.currentState);
const [isClipboardContentModalVisible, setIsClipboardContentModalVisible] = useState(false);
const [clipboardContentType, setClipboardContentType] = useState();
const [clipboardContent, setClipboardContent] = useState('');
const clipboardContent = useRef();
const colorScheme = useColorScheme();
const stylesHook = StyleSheet.create({
modalContent: {
@ -217,7 +217,7 @@ const App = () => {
const isBothBitcoinAndLightning = DeeplinkSchemaMatch.isBothBitcoinAndLightning(clipboard);
if (
!isAddressFromStoredWallet &&
clipboardContent !== clipboard &&
clipboardContent.current !== clipboard &&
(isBitcoinAddress || isLightningInvoice || isLNURL || isBothBitcoinAndLightning)
) {
if (isBitcoinAddress) {
@ -229,7 +229,7 @@ const App = () => {
}
setIsClipboardContentModalVisible(true);
}
setClipboardContent(clipboard);
clipboardContent.current = clipboard;
}
if (nextAppState) {
appState.current = nextAppState;