Merge pull request #2392 from BlueWallet/clipboard

FIX: Don't show clipboard modal if user has already acted on it
This commit is contained in:
GLaDOS 2020-12-19 20:38:33 +00:00 committed by GitHub
commit 6afbf9563a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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;