This commit is contained in:
parent
b6035fbbdf
commit
d9fba50606
@ -2111,11 +2111,15 @@ impl LoginConfigHandler {
|
||||
};
|
||||
let mut display_name = get_buildin_option(config::keys::OPTION_DISPLAY_NAME);
|
||||
if display_name.is_empty() {
|
||||
display_name = serde_json::from_str::<HashMap<String, String>>(
|
||||
&LocalConfig::get_option("user_info"),
|
||||
)
|
||||
.map(|mut x| x.remove("name").unwrap_or_default())
|
||||
.unwrap_or_default();
|
||||
display_name =
|
||||
serde_json::from_str::<serde_json::Value>(&LocalConfig::get_option("user_info"))
|
||||
.map(|x| {
|
||||
x.get("name")
|
||||
.map(|x| x.as_str().unwrap_or_default())
|
||||
.unwrap_or_default()
|
||||
.to_owned()
|
||||
})
|
||||
.unwrap_or_default();
|
||||
}
|
||||
if display_name.is_empty() {
|
||||
display_name = crate::username();
|
||||
|
Loading…
x
Reference in New Issue
Block a user