mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
modals: refuse to build modal if no fields have been provided
This commit is contained in:
parent
0c17bb6e34
commit
d06c6dcb32
1 changed files with 6 additions and 0 deletions
|
|
@ -30,6 +30,12 @@ impl<'a> AlertModalBuilder<'a> {
|
||||||
let mut final_placeholders: Option<[Option<xous_ipc::String<256>>; 10]> = None;
|
let mut final_placeholders: Option<[Option<xous_ipc::String<256>>; 10]> = None;
|
||||||
let fields_amt = self.validators.len();
|
let fields_amt = self.validators.len();
|
||||||
|
|
||||||
|
if fields_amt == 0 {
|
||||||
|
log::error!("must add at least one field to alert");
|
||||||
|
self.modals.unlock();
|
||||||
|
return Err(xous::Error::UnknownError);
|
||||||
|
}
|
||||||
|
|
||||||
match self.placeholders.len() {
|
match self.placeholders.len() {
|
||||||
1.. => {
|
1.. => {
|
||||||
let mut pl:[Option<xous_ipc::String<256>>; 10] = Default::default();
|
let mut pl:[Option<xous_ipc::String<256>>; 10] = Default::default();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue