UI: check if dongle id is valid before calling API (#21275)

old-commit-hash: e85fa7f1c933baafdecb4a52c16f2003215d423b
This commit is contained in:
Willem Melching
2021-06-15 14:10:44 +02:00
committed by GitHub
parent d0e5f3fb92
commit 196f96f057
4 changed files with 23 additions and 16 deletions

View File

@@ -155,6 +155,10 @@ std::string dir_name(std::string const &path) {
return path.substr(0, pos);
}
bool is_valid_dongle_id(std::string const& dongle_id) {
return !dongle_id.empty() && dongle_id != "UnregisteredDevice";
}
struct tm get_time() {
time_t rawtime;
time(&rawtime);