Merge pull request #1110 from 21pages/enc-id

avoid modify id manually
This commit is contained in:
RustDesk
2022-08-20 21:08:40 +08:00
committed by GitHub
4 changed files with 54 additions and 4 deletions

View File

@@ -166,7 +166,7 @@ fn main() {
}
fn import_config(path: &str) {
use hbb_common::{config::*, get_modified_time};
use hbb_common::{config::*, get_exe_time, get_modified_time};
let path2 = path.replace(".toml", "2.toml");
let path2 = std::path::Path::new(&path2);
let path = std::path::Path::new(path);
@@ -176,7 +176,9 @@ fn import_config(path: &str) {
log::info!("Empty source config, skipped");
return;
}
if get_modified_time(&path) > get_modified_time(&Config::file()) {
if get_modified_time(&path) > get_modified_time(&Config::file())
&& get_modified_time(&path) < get_exe_time()
{
if store_path(Config::file(), config).is_err() {
log::info!("config written");
}