mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-05-15 10:25:40 +00:00
20 lines
560 B
TypeScript
20 lines
560 B
TypeScript
/**
|
|
* 配置持久化相关的函数
|
|
* 用于保存和加载应用程序的各种配置状态
|
|
*/
|
|
|
|
/**
|
|
* 保存上次使用的网络实例 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')
|
|
} |