Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
buffge committed Mar 4, 2022
1 parent 06884ac commit c3c0971
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bootstrap/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func initClientConf() (err error) {
dbPath := conf.SqliteDBPath
var db *gorm.DB
var dbLogger = gormLogger.Discard
if !global.IsDevMode() {
if global.IsDevMode() {
dbLogger = gormLogger.Default
}
gormCfg := &gorm.Config{
Expand Down
1 change: 1 addition & 0 deletions conf/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type (
ChooseSendHorseMsg *[6]bool `json:"chooseSendHorseMsg"`
ChooseChampSendMsgDelaySec *int `json:"chooseChampSendMsgDelaySec"`
ShouldInGameSaveMsgToClipBoard *bool `json:"shouldInGameSaveMsgToClipBoard"`
ShouldAutoOpenBrowser *bool `json:"shouldAutoOpenBrowser"`
}
)

Expand Down
7 changes: 6 additions & 1 deletion global/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ const (
)

var (
DefaultClientConf = conf.Client{
defaultShouldAutoOpenBrowserCfg = true
DefaultClientConf = conf.Client{
AutoAcceptGame: false,
AutoPickChampID: 0,
AutoBanChampID: 0,
Expand All @@ -44,6 +45,7 @@ var (
ChooseSendHorseMsg: [6]bool{true, true, true, true, true, true},
ChooseChampSendMsgDelaySec: 3,
ShouldInGameSaveMsgToClipBoard: true,
ShouldAutoOpenBrowser: &defaultShouldAutoOpenBrowserCfg,
}
DefaultAppConf = conf.AppConf{
Mode: conf.ModeProd,
Expand Down Expand Up @@ -212,6 +214,9 @@ func SetClientConf(cfg conf.UpdateClientConfReq) *conf.Client {
if cfg.ShouldInGameSaveMsgToClipBoard != nil {
ClientConf.ShouldInGameSaveMsgToClipBoard = *cfg.ShouldInGameSaveMsgToClipBoard
}
if cfg.ShouldAutoOpenBrowser != nil {
ClientConf.ShouldAutoOpenBrowser = cfg.ShouldAutoOpenBrowser
}
return ClientConf
}
func SetAppInfo(info AppInfo) {
Expand Down

0 comments on commit c3c0971

Please sign in to comment.