Merge branch 'empty-url' into 'master'

headerbar: Don't show error when add input is empty

See merge request World/podcasts!108
This commit is contained in:
Jordan Petridis 2019-06-09 04:18:48 +00:00
commit 957b47680d

View File

@ -96,6 +96,7 @@ impl AddPopover {
.entry .entry
.get_text() .get_text()
.ok_or_else(|| format_err!("GtkEntry blew up somehow."))?; .ok_or_else(|| format_err!("GtkEntry blew up somehow."))?;
let is_input_url_empty = url.is_empty();
debug!("Url: {}", url); debug!("Url: {}", url);
if !(url.starts_with("https://") || url.starts_with("http://")) { if !(url.starts_with("https://") || url.starts_with("http://")) {
@ -131,7 +132,7 @@ impl AddPopover {
} }
Err(err) => { Err(err) => {
self.add.set_sensitive(false); self.add.set_sensitive(false);
if !url.is_empty() { if !is_input_url_empty {
self.entry self.entry
.get_style_context() .get_style_context()
.add_class(&gtk::STYLE_CLASS_ERROR); .add_class(&gtk::STYLE_CLASS_ERROR);