From 64fb659e86509931a4ca0cea86c3a9dd78dbb832 Mon Sep 17 00:00:00 2001 From: aeddi Date: Fri, 9 Nov 2018 16:46:58 +0100 Subject: [PATCH] feat(devtools): added and commented (until StopBot function is implemented) lines to save bot mode state in DB --- client/react-native/gomobile/core/bot.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/client/react-native/gomobile/core/bot.go b/client/react-native/gomobile/core/bot.go index fcacc6ab92..b9db95c70e 100644 --- a/client/react-native/gomobile/core/bot.go +++ b/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" ) @@ -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() } @@ -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() }