mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 02:22:17 +00:00
FIX: erase the access code records while empty
jira: [STUDIO-11102] Change-Id: Iab43485789f74e635b7de195cbe8683f6b9e9be6 (cherry picked from commit 9441a32ca363aad727cf8c66e2f61953598a15a3)
This commit is contained in:
@@ -543,9 +543,13 @@ void MachineObject::set_access_code(std::string code, bool only_refresh)
|
||||
this->access_code = code;
|
||||
if (only_refresh) {
|
||||
AppConfig* config = GUI::wxGetApp().app_config;
|
||||
if (config && !code.empty()) {
|
||||
GUI::wxGetApp().app_config->set_str("access_code", dev_id, code);
|
||||
DeviceManager::update_local_machine(*this);
|
||||
if (config) {
|
||||
if (!code.empty()) {
|
||||
GUI::wxGetApp().app_config->set_str("access_code", dev_id, code);
|
||||
DeviceManager::update_local_machine(*this);
|
||||
} else {
|
||||
GUI::wxGetApp().app_config->erase("access_code", dev_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user