Skip to content

Commit

Permalink
feat(devtools): added and commented (until StopBot function is implem…
Browse files Browse the repository at this point in the history
…ented) lines to save bot mode state in DB
  • Loading branch information
aeddi committed Nov 9, 2018
1 parent a05dd6f commit 64fb659
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion client/react-native/gomobile/core/bot.go
@@ -1,7 +1,7 @@
package core

import (
"errors"
"github.com/pkg/errors"

account "berty.tech/core/manager/account"
)
Expand All @@ -21,6 +21,13 @@ func StartBot() error {
return errors.New("bot is already started")
}

// TODO: re-enable this when account.StopBot() will be implemented
// appConfig.BotMode = true
// appConfig.StartCounter++
// if err := appConfig.Save(); err != nil {
// return errors.Wrap(err, "state DB save failed")
// }

return currentAccount.StartBot()
}

Expand All @@ -32,5 +39,12 @@ func StopBot() error {
return errors.New("bot is already stopped")
}

// TODO: re-enable this when account.StopBot() will be implemented
// appConfig.BotMode = false
// appConfig.StartCounter++
// if err := appConfig.Save(); err != nil {
// return errors.Wrap(err, "state DB save failed")
// }

return currentAccount.StopBot()
}

0 comments on commit 64fb659

Please sign in to comment.