From 2078051d7c8433ceda4240d41952cff32308990c Mon Sep 17 00:00:00 2001 From: YetAnotherZephyruso <176294927+YetAnotherZephyruso@users.noreply.github.com> Date: Sun, 8 Sep 2024 10:20:26 +0800 Subject: [PATCH] feat: make persisted for ipv6 result (#983) --- src/signals/ipv6.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/signals/ipv6.ts b/src/signals/ipv6.ts index 009b77e..233a042 100644 --- a/src/signals/ipv6.ts +++ b/src/signals/ipv6.ts @@ -1,3 +1,4 @@ +import { makePersisted } from '@solid-primitives/storage' import { proxyGroupLatencyTestAPI, proxyLatencyTestAPI } from '~/apis' import { latencyQualityMap, @@ -5,9 +6,13 @@ import { urlForIPv6SupportTest, } from './config' -export const [proxyIPv6SupportMap, setProxyIPv6SupportMap] = createSignal< - Record ->({}) +export const [proxyIPv6SupportMap, setProxyIPv6SupportMap] = makePersisted( + createSignal>({}), + { + name: 'proxyIPv6SupportMap', + storage: localStorage, + }, +) export const proxyIPv6SupportTest = async ( proxyName: string,