mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-12-12 18:29:10 +08:00
Merge pull request #5344 from 21pages/fix
remove not save peer config when version is zero
This commit is contained in:
commit
ea12eccc90
@ -1151,10 +1151,6 @@ 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;
|
||||
}
|
||||
|
@ -850,11 +850,6 @@ impl<T: InvokeUiSession> Remote<T> {
|
||||
}
|
||||
|
||||
pub async fn sync_jobs_status_to_local(&mut self) -> bool {
|
||||
let peer_version = self.handler.lc.read().unwrap().version;
|
||||
if peer_version == 0 {
|
||||
log::info!("skip saving job status");
|
||||
return false;
|
||||
}
|
||||
log::info!("sync transfer job status");
|
||||
let mut config: PeerConfig = self.handler.load_config();
|
||||
let mut transfer_metas = TransferSerde::default();
|
||||
@ -867,8 +862,10 @@ impl<T: InvokeUiSession> Remote<T> {
|
||||
transfer_metas.write_jobs.push(json_str);
|
||||
}
|
||||
log::info!("meta: {:?}", transfer_metas);
|
||||
config.transfer = transfer_metas;
|
||||
self.handler.save_config(config);
|
||||
if config.transfer != transfer_metas {
|
||||
config.transfer = transfer_metas;
|
||||
self.handler.save_config(config);
|
||||
}
|
||||
true
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user