-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
client: Use the app build version as Version in UI in hamburger menu. #3121
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -144,6 +144,7 @@ type Config struct { | |||||||||
WebConfig | ||||||||||
LogConfig | ||||||||||
MMConfig | ||||||||||
AppVersion string | ||||||||||
// AppData and ConfigPath should be parsed from the command-line, | ||||||||||
// as it makes no sense to set these in the config file itself. If no values | ||||||||||
// are assigned, defaults will be used. | ||||||||||
|
@@ -195,6 +196,9 @@ func (cfg *Config) Web(c *core.Core, mm *mm.MarketMaker, log dex.Logger, utc boo | |||||||||
UTC: utc, | ||||||||||
CertFile: certFile, | ||||||||||
KeyFile: keyFile, | ||||||||||
NoEmbed: cfg.NoEmbedSite, | ||||||||||
HttpProf: cfg.HTTPProfile, | ||||||||||
AppVersion: cfg.AppVersion, | ||||||||||
Comment on lines
+199
to
+201
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
Language: cfg.Language, | ||||||||||
Tor: cfg.Tor, | ||||||||||
} | ||||||||||
|
@@ -349,9 +353,17 @@ func ResolveConfig(appData string, cfg *Config) error { | |||||||||
if cfg.MMConfig.EventLogDBPath == "" { | ||||||||||
cfg.MMConfig.EventLogDBPath = defaultMMEventLogDBPath | ||||||||||
} | ||||||||||
|
||||||||||
cfg.AppVersion = userAppVersion(Version) | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to add to this config I think. |
||||||||||
return nil | ||||||||||
} | ||||||||||
|
||||||||||
// userAppVersion returns a simple user-facing version: maj.min.patch. | ||||||||||
func userAppVersion(fullVersion string) string { | ||||||||||
parts := strings.Split(fullVersion, "-") | ||||||||||
return parts[0] | ||||||||||
} | ||||||||||
|
||||||||||
// setNet sets the filepath for the network directory and some network specific | ||||||||||
// files. It returns a suggested path for the database file and a log file. If | ||||||||||
// using a file rotator, the directory of the log filepath as parsed by | ||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,6 +58,7 @@ type CommonArguments struct { | |
UserInfo *userInfo | ||
Title string | ||
UseDEXBranding bool | ||
Version string | ||
} | ||
|
||
// Create the CommonArguments for the request. | ||
|
@@ -66,6 +67,7 @@ func (s *WebServer) commonArgs(r *http.Request, title string) *CommonArguments { | |
UserInfo: extractUserInfo(r), | ||
Title: title, | ||
UseDEXBranding: s.useDEXBranding, | ||
Version: s.appVersion, | ||
} | ||
} | ||
|
||
|
@@ -292,13 +294,15 @@ func (s *WebServer) handleSettings(w http.ResponseWriter, r *http.Request) { | |
FiatCurrency string | ||
Exchanges map[string]*core.Exchange | ||
IsInitialized bool | ||
AppVersion string | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is currently unused, can remove. |
||
}{ | ||
CommonArguments: *common, | ||
KnownExchanges: s.knownUnregisteredExchanges(xcs), | ||
FiatCurrency: core.DefaultFiatCurrency, | ||
FiatRateSources: s.core.FiatRateSources(), | ||
Exchanges: xcs, | ||
IsInitialized: s.core.IsInitialized(), | ||
AppVersion: s.appVersion, | ||
} | ||
s.sendTemplate(w, "settings", data) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to add this.