mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-05-15 18:35:47 +00:00
feat(gui): persist and restore last used network instance ID (#1762)
This commit is contained in:
@@ -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')
|
||||
}
|
||||
Reference in New Issue
Block a user