mirror of
https://github.com/djibux/BoilR.git
synced 2026-09-01 05:53:41 +02:00
Steamline how auth_key input is assigned (#147)
This commit is contained in:
@@ -179,16 +179,19 @@ impl MyEguiApp {
|
|||||||
ui.checkbox(&mut self.settings.steamgrid_db.enabled, "Download images");
|
ui.checkbox(&mut self.settings.steamgrid_db.enabled, "Download images");
|
||||||
if self.settings.steamgrid_db.enabled {
|
if self.settings.steamgrid_db.enabled {
|
||||||
ui.horizontal(|ui| {
|
ui.horizontal(|ui| {
|
||||||
let mut empty_string = "".to_string();
|
let mut auth_key = self
|
||||||
let auth_key = self
|
|
||||||
.settings
|
.settings
|
||||||
.steamgrid_db
|
.steamgrid_db
|
||||||
.auth_key
|
.auth_key
|
||||||
.as_mut()
|
.clone()
|
||||||
.unwrap_or(&mut empty_string);
|
.unwrap_or_default();
|
||||||
ui.label("Authentication key: ");
|
ui.label("Authentication key: ");
|
||||||
if ui.text_edit_singleline(auth_key).changed() {
|
if ui.text_edit_singleline(&mut auth_key).changed() {
|
||||||
*auth_key = auth_key.to_string();
|
if auth_key.is_empty(){
|
||||||
|
self.settings.steamgrid_db.auth_key = None;
|
||||||
|
}else{
|
||||||
|
self.settings.steamgrid_db.auth_key = Some(auth_key.to_string());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if auth_key.is_empty() {
|
if auth_key.is_empty() {
|
||||||
if ui.button("Paste from clipboard").clicked() {
|
if ui.button("Paste from clipboard").clicked() {
|
||||||
|
|||||||
Reference in New Issue
Block a user