Skip to content

Commit

Permalink
Change comments
Browse files Browse the repository at this point in the history
- Remove redundant field at loginModal and walletInfoWidget
  • Loading branch information
song50119 committed Oct 30, 2021
1 parent a43b90e commit 6d5e0c7
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 26 deletions.
4 changes: 2 additions & 2 deletions dexc/dexc.go
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 0 additions & 3 deletions dexc/log.go
Expand Up @@ -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
}
6 changes: 3 additions & 3 deletions log.go
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion main.go
Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions ui/page/dexclient/add_dex_modal.go
Expand Up @@ -26,7 +26,6 @@ type addDexModal struct {

type walletInfoWidget struct {
image *decredmaterial.Image
coin string
coinName string
coinID uint32
}
Expand Down Expand Up @@ -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,
})
Expand Down
3 changes: 1 addition & 2 deletions ui/page/dexclient/create_wallet_modal.go
Expand Up @@ -2,7 +2,6 @@ package dexclient

import (
"fmt"
"strings"

"decred.org/dcrdex/client/asset/btc"
"decred.org/dcrdex/client/asset/dcr"
Expand Down Expand Up @@ -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
}

Expand Down
5 changes: 2 additions & 3 deletions ui/page/dexclient/login_modal.go
Expand Up @@ -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 {
Expand Down
11 changes: 1 addition & 10 deletions ui/page/main_page.go
Expand Up @@ -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"
)

Expand Down

0 comments on commit 6d5e0c7

Please sign in to comment.