diff --git a/dexc/dexc.go b/dexc/dexc.go index 62f566adf..a147eb99d 100644 --- a/dexc/dexc.go +++ b/dexc/dexc.go @@ -14,7 +14,7 @@ import ( "decred.org/dcrdex/dex" ) -// Dexc represents of the Decred exchange client. +// Dexc represents the Decred Dex client. type Dexc struct { *core.Core ctx context.Context @@ -111,7 +111,7 @@ func (d *Dexc) Shutdown() bool { return d.shutdown(false) } -// Shutdown causes the dex client to shutdown regardless of whether or not there +// ForceShutdown causes the dex client to shutdown regardless of whether or not there // are active orders. Dexc will need to be restarted before it can be used again. func (d *Dexc) ForceShutdown() { d.shutdown(true) diff --git a/dexc/log.go b/dexc/log.go index aed21485f..af8bf73c5 100644 --- a/dexc/log.go +++ b/dexc/log.go @@ -10,18 +10,15 @@ import ( // log is a logger that is initialized with no output filters. This // means the package will not perform any logging by default until the caller // requests it. -var apiLog = slog.Disabled var log = slog.Disabled // DisableLog disables all library log output. Logging output is disabled // by default until UseLogger is called. func DisableLog() { - apiLog = slog.Disabled log = slog.Disabled } // UseLogger uses a specified Logger to output package logging info. func UseLogger(logger slog.Logger) { - apiLog = logger log = logger } diff --git a/log.go b/log.go index 50d8a5513..35cc0a58f 100644 --- a/log.go +++ b/log.go @@ -121,10 +121,10 @@ func setLogLevels(logLevel string) { } } -// initLogging initializes the logging rotater to write logs to logFile and -// create roll files in the same directory. initLogging must be called before +// initDexLogging initializes the logging rotater to write logs to logFile and +// create roll files in the same directory. initDexLogging must be called before // the package-global log rotator variables are used. -func initLogging(lvl string, utc bool, w io.Writer) *dex.LoggerMaker { +func initDexLogging(lvl string, utc bool, w io.Writer) *dex.LoggerMaker { lm, err := dex.NewLoggerMaker(w, lvl, utc) if err != nil { fmt.Fprintf(os.Stderr, "failed to create custom logger: %v\n", err) diff --git a/main.go b/main.go index a78219c54..db526f871 100644 --- a/main.go +++ b/main.go @@ -70,7 +70,7 @@ func main() { }() dbPath := filepath.Join(cfg.HomeDir, cfg.Network, "dexc.db") - logMaker := initLogging(cfg.DebugLevel, true, logWriter{}) + logMaker := initDexLogging(cfg.DebugLevel, true, logWriter{}) dexc, err := dexc.NewDex(dbPath, cfg.Network, logMaker) if err != nil { log.Errorf("error creating Dex: %s", err) diff --git a/ui/page/dexclient/add_dex_modal.go b/ui/page/dexclient/add_dex_modal.go index f0ba60a95..62c39647a 100644 --- a/ui/page/dexclient/add_dex_modal.go +++ b/ui/page/dexclient/add_dex_modal.go @@ -26,7 +26,6 @@ type addDexModal struct { type walletInfoWidget struct { image *decredmaterial.Image - coin string coinName string coinID uint32 } @@ -120,7 +119,6 @@ func (md *addDexModal) Handle() { } else { newWalletModal := newCreateWalletModal(md.Load, &walletInfoWidget{ image: coinImageBySymbol(&md.Load.Icons, feeAssetName), - coin: feeAssetName, coinName: feeAssetName, coinID: feeAsset.ID, }) diff --git a/ui/page/dexclient/create_wallet_modal.go b/ui/page/dexclient/create_wallet_modal.go index acfb534c6..47d7d67e4 100644 --- a/ui/page/dexclient/create_wallet_modal.go +++ b/ui/page/dexclient/create_wallet_modal.go @@ -2,7 +2,6 @@ package dexclient import ( "fmt" - "strings" "decred.org/dcrdex/client/asset/btc" "decred.org/dcrdex/client/asset/dcr" @@ -88,7 +87,7 @@ func (md *createWalletModal) OnResume() { func (md *createWalletModal) Handle() { if md.createNewWallet.Button.Clicked() { - if strings.Trim(md.appPassword.Editor.Text(), " ") == "" || md.isSending { + if md.appPassword.Editor.Text() == "" || md.isSending { return } diff --git a/ui/page/dexclient/login_modal.go b/ui/page/dexclient/login_modal.go index f7aed7895..c42e3b9a5 100644 --- a/ui/page/dexclient/login_modal.go +++ b/ui/page/dexclient/login_modal.go @@ -15,9 +15,8 @@ type loginModal struct { modal *decredmaterial.Modal loggedIn func() - submit decredmaterial.Button - appPassword decredmaterial.Editor - marketBaseID, marketQuoteID uint32 + submit decredmaterial.Button + appPassword decredmaterial.Editor } func newloginModal(l *load.Load) *loginModal { diff --git a/ui/page/main_page.go b/ui/page/main_page.go index 2a2ecf835..e6f3ee2b7 100644 --- a/ui/page/main_page.go +++ b/ui/page/main_page.go @@ -21,17 +21,8 @@ import ( "github.com/planetdecred/godcr/ui/values" ) -const MainPageID = "Main" - const ( - OverviewNavID = iota - TransactionsNavID - WalletsNavID - TicketsNavID - ProposalsNavID - MoreNavID - DexNavID - + MainPageID = "Main" HideBalanceConfigKey = "hide_balance" )