update key pair when set config

Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
21pages
2026-01-27 15:24:38 +08:00
parent 900077a2c2
commit de0d7fded0

View File

@@ -992,6 +992,10 @@ impl Config {
config.key_pair
}
pub fn get_cached_pk() -> Option<Vec<u8>> {
KEY_PAIR.lock().unwrap().clone().map(|k| k.1)
}
pub fn no_register_device() -> bool {
BUILTIN_SETTINGS
.read()
@@ -1352,6 +1356,11 @@ impl Config {
}
*lock = cfg;
lock.store();
// Currently only tested on macOS, so this change is limited to macOS for safety.
#[cfg(target_os = "macos")]
{
*KEY_PAIR.lock().unwrap() = Some(lock.key_pair.clone());
}
true
}