mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-03-26 08:55:56 +01:00
FIX: can't access storage for unsigned transaction export #5559
This commit is contained in:
parent
368b15bab4
commit
3684814e21
4 changed files with 16 additions and 5 deletions
|
@ -17,7 +17,7 @@ const writeFileAndExportToAndroidDestionation = async ({ filename, contents, des
|
|||
buttonNegative: loc._.cancel,
|
||||
buttonPositive: loc._.ok,
|
||||
});
|
||||
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
|
||||
if (granted === PermissionsAndroid.RESULTS.GRANTED || Platform.Version >= 33) {
|
||||
const filePath = destination + `/${filename}`;
|
||||
try {
|
||||
await RNFS.writeFile(filePath, contents);
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { ScrollView, View, StyleSheet, Linking } from 'react-native';
|
||||
import { ScrollView, View, StyleSheet, Linking, Platform } from 'react-native';
|
||||
import wif from 'wif';
|
||||
import bip38 from 'bip38';
|
||||
import BIP32Factory from 'bip32';
|
||||
|
||||
import loc from '../loc';
|
||||
import { BlueSpacing20, SafeBlueArea, BlueCard, BlueText, BlueLoading } from '../BlueComponents';
|
||||
import { BlueSpacing20, SafeBlueArea, BlueCard, BlueText, BlueLoading, BlueButton } from '../BlueComponents';
|
||||
import navigationStyle from '../components/navigationStyle';
|
||||
import {
|
||||
SegwitP2SHWallet,
|
||||
|
@ -22,6 +22,7 @@ const BlueCrypto = require('react-native-blue-crypto');
|
|||
const encryption = require('../blue_modules/encryption');
|
||||
const BlueElectrum = require('../blue_modules/BlueElectrum');
|
||||
const bip32 = BIP32Factory(ecc);
|
||||
const fs = require('../blue_modules/fs');
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
center: {
|
||||
|
@ -37,6 +38,10 @@ export default class Selftest extends Component {
|
|||
};
|
||||
}
|
||||
|
||||
onPressSaveToStorage = () => {
|
||||
fs.writeFileAndExport('bluewallet-storagesave-test.txt', 'Success');
|
||||
};
|
||||
|
||||
async componentDidMount() {
|
||||
let errorMessage = '';
|
||||
let isOk = true;
|
||||
|
@ -293,6 +298,12 @@ export default class Selftest extends Component {
|
|||
);
|
||||
}
|
||||
})()}
|
||||
{Platform.OS === 'android' && (
|
||||
<>
|
||||
<BlueSpacing20 />
|
||||
<BlueButton title="Test Save to Storage" onPress={this.onPressSaveToStorage} />
|
||||
</>
|
||||
)}
|
||||
</ScrollView>
|
||||
</BlueCard>
|
||||
</SafeBlueArea>
|
||||
|
|
|
@ -76,7 +76,7 @@ const SendCreate = () => {
|
|||
buttonPositive: loc._.ok,
|
||||
});
|
||||
|
||||
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
|
||||
if (granted === PermissionsAndroid.RESULTS.GRANTED || Platform.Version >= 33) {
|
||||
console.log('Storage Permission: Granted');
|
||||
const filePath = RNFS.DownloadDirectoryPath + `/${fileName}`;
|
||||
try {
|
||||
|
|
|
@ -371,7 +371,7 @@ const WalletDetails = () => {
|
|||
buttonPositive: loc._.ok,
|
||||
});
|
||||
|
||||
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
|
||||
if (granted === PermissionsAndroid.RESULTS.GRANTED || Platform.Version >= 33) {
|
||||
console.log('Storage Permission: Granted');
|
||||
const filePath = RNFS.DownloadDirectoryPath + `/${fileName}`;
|
||||
try {
|
||||
|
|
Loading…
Add table
Reference in a new issue