feat(gui): persist and restore last used network instance ID (#1762)

This commit is contained in:
Mg Pig
2026-01-08 17:03:51 +08:00
committed by GitHub
parent 4bfea06a12
commit 0c16e2211b
3 changed files with 36 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
/**
* 配置持久化相关的函数
* 用于保存和加载应用程序的各种配置状态
*/
/**
* 保存上次使用的网络实例 ID
* @param instanceId 网络实例 ID
*/
export function saveLastNetworkInstanceId(instanceId: string) {
localStorage.setItem('last_network_instance_id', instanceId)
}
/**
* 加载上次使用的网络实例 ID
* @returns 上次使用的网络实例 ID,如果没有则返回 null
*/
export function loadLastNetworkInstanceId(): string | null {
return localStorage.getItem('last_network_instance_id')
}