Skip to content

Commit

Permalink
fix(rn): devtools daemon bridge
Browse files Browse the repository at this point in the history
Signed-off-by: Godefroy Ponsinet <godefroy.ponsinet@outlook.com>
  • Loading branch information
90dy committed Jun 7, 2019
1 parent 4bb0829 commit 093ac42
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
Expand Up @@ -32,11 +32,11 @@ const Bluetooth = ({ bridge, navigation, t }) => (
</SkipButton>
<NextButton
onPress={async () => {
const config = await bridge.getNetworkConfig({})
const config = await bridge.daemon.getNetworkConfig({})

let currentConfig = JSON.parse(config.json)
currentConfig.BLE = true
await bridge.updateNetworkConfig({
await bridge.daemon.updateNetworkConfig({
json: JSON.stringify(currentConfig),
})
navigation.navigate('onboarding/contacts')
Expand Down
Expand Up @@ -37,7 +37,7 @@ class Database extends PureComponent {

this.props.navigation.setParams({ dropDatabase: true })
try {
await bridge.dropDatabase({})
await bridge.daemon.dropDatabase({})
} catch (err) {
Alert.alert('An error occured, please, kill and restart the app')
console.error(err)
Expand Down
20 changes: 10 additions & 10 deletions client/react-native/app/view/screen/Settings/Devtools/List.js
Expand Up @@ -36,7 +36,7 @@ class List extends PureComponent {
this.props.navigation.setParams({ restartDaemon: true })
this.setState({ restartDaemon: true }, async () => {
try {
await bridge.restart({})
await bridge.daemon.restart({})
} catch (err) {
console.error(err)
}
Expand All @@ -52,7 +52,7 @@ class List extends PureComponent {

this.props.navigation.setParams({ testPanic: true })
this.setState({ testPanic: true }, async () => {
await bridge.panic({})
await bridge.daemon.panic({})

this.props.navigation.setParams({
testPanic: false,
Expand All @@ -66,7 +66,7 @@ class List extends PureComponent {

this.props.navigation.setParams({ testError: true })
this.setState({ testError: true }, async () => {
await bridge.error({})
await bridge.daemon.error({})

this.props.navigation.setParams({
testError: false,
Expand Down Expand Up @@ -112,7 +112,7 @@ class List extends PureComponent {
const { bridge } = this.props

try {
const { isBotRunning } = await bridge.getBotState({})
const { isBotRunning } = await bridge.daemon.getBotState({})

this.setState({
botRunning: isBotRunning,
Expand All @@ -132,9 +132,9 @@ class List extends PureComponent {
this.antispamBot = true
try {
if (this.state.botRunning === true) {
await bridge.stopBot({})
await bridge.daemon.stopBot({})
} else {
await bridge.startBot({})
await bridge.daemon.startBot({})
}

this.setState({ botRunning: !this.state.botRunning })
Expand All @@ -150,7 +150,7 @@ class List extends PureComponent {
const { bridge } = this.props

try {
let config = await bridge.getLocalGrpcInfos({})
let config = await bridge.daemon.getLocalGrpcInfos({})
let infos = JSON.parse(config.json)

this.setState({
Expand All @@ -171,9 +171,9 @@ class List extends PureComponent {
this.antispamLocalGRPC = true
try {
if (this.state.localGRPCRunning === true) {
await bridge.stopLocalGRPC({})
await bridge.daemon.stopLocalGRPC({})
} else {
await bridge.startLocalGRPC({})
await bridge.daemon.startLocalGRPC({})
}

this.setState({ localGRPCRunning: !this.state.localGRPCRunning })
Expand All @@ -192,7 +192,7 @@ class List extends PureComponent {

throwNativeException = () => {
const { bridge } = this.props
bridge.throwException({}).catch(err => {
bridge.daemon.throwException({}).catch(err => {
Alert.alert('Error', `${err}`)
})
}
Expand Down
Expand Up @@ -26,7 +26,7 @@ class Network extends PureComponent {
async componentDidMount () {
const { bridge } = this.props

const config = await bridge.getNetworkConfig({})
const config = await bridge.daemon.getNetworkConfig({})
console.warn(config.json)
this.setState(JSON.parse(config.json))
}
Expand All @@ -38,7 +38,7 @@ class Network extends PureComponent {
this.props.navigation.setParams({ updating: true })
this.setState(config, async () => {
try {
await bridge.updateNetworkConfig({
await bridge.daemon.updateNetworkConfig({
json: JSON.stringify(this.state),
})
} catch (err) {
Expand Down

0 comments on commit 093ac42

Please sign in to comment.