fix keep peer card order when connect failed

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages 2023-08-09 18:38:43 +08:00
parent 09a6b3c30a
commit 5028b8a93d

View File

@ -1151,6 +1151,10 @@ impl LoginConfigHandler {
///
/// * `config` - [`PeerConfig`] to save.
pub fn save_config(&mut self, config: PeerConfig) {
if self.version == 0 {
log::info!("skip saving peer config {}", self.id);
return;
}
config.store(&self.id);
self.config = config;
}
@ -1209,10 +1213,6 @@ impl LoginConfigHandler {
/// * `k` - key of option
/// * `v` - value of option
pub fn save_ui_flutter(&mut self, k: String, v: String) {
if self.version == 0 && k == "wm_" {
log::info!("skip saving {k}");
return;
}
let mut config = self.load_config();
config.ui_flutter.insert(k, v);
self.save_config(config);