chore: generate
This commit is contained in:
@@ -1614,9 +1614,7 @@ export default function Layout(props: ParentProps) {
|
|||||||
</Collapsible.Trigger>
|
</Collapsible.Trigger>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<div class="flex items-center justify-between w-full pl-2 pr-16 py-1.5 rounded-md">
|
<div class="flex items-center justify-between w-full pl-2 pr-16 py-1.5 rounded-md">{header()}</div>
|
||||||
{header()}
|
|
||||||
</div>
|
|
||||||
</Show>
|
</Show>
|
||||||
<div
|
<div
|
||||||
class="absolute right-1 top-1/2 -translate-y-1/2 flex items-center gap-0.5 transition-opacity"
|
class="absolute right-1 top-1/2 -translate-y-1/2 flex items-center gap-0.5 transition-opacity"
|
||||||
|
|||||||
@@ -89,26 +89,26 @@ const createPlatform = (password: Accessor<string | null>): Platform => ({
|
|||||||
length(): Promise<number>
|
length(): Promise<number>
|
||||||
}
|
}
|
||||||
|
|
||||||
const WRITE_DEBOUNCE_MS = 250
|
const WRITE_DEBOUNCE_MS = 250
|
||||||
|
|
||||||
const storeCache = new Map<string, Promise<StoreLike>>()
|
const storeCache = new Map<string, Promise<StoreLike>>()
|
||||||
const apiCache = new Map<string, AsyncStorage & { flush: () => Promise<void> }>()
|
const apiCache = new Map<string, AsyncStorage & { flush: () => Promise<void> }>()
|
||||||
const memoryCache = new Map<string, StoreLike>()
|
const memoryCache = new Map<string, StoreLike>()
|
||||||
|
|
||||||
const flushAll = async () => {
|
const flushAll = async () => {
|
||||||
const apis = Array.from(apiCache.values())
|
const apis = Array.from(apiCache.values())
|
||||||
await Promise.all(apis.map((api) => api.flush().catch(() => undefined)))
|
await Promise.all(apis.map((api) => api.flush().catch(() => undefined)))
|
||||||
|
}
|
||||||
|
|
||||||
|
if ("addEventListener" in globalThis) {
|
||||||
|
const handleVisibility = () => {
|
||||||
|
if (document.visibilityState !== "hidden") return
|
||||||
|
void flushAll()
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("addEventListener" in globalThis) {
|
window.addEventListener("pagehide", () => void flushAll())
|
||||||
const handleVisibility = () => {
|
document.addEventListener("visibilitychange", handleVisibility)
|
||||||
if (document.visibilityState !== "hidden") return
|
}
|
||||||
void flushAll()
|
|
||||||
}
|
|
||||||
|
|
||||||
window.addEventListener("pagehide", () => void flushAll())
|
|
||||||
document.addEventListener("visibilitychange", handleVisibility)
|
|
||||||
}
|
|
||||||
|
|
||||||
const createMemoryStore = () => {
|
const createMemoryStore = () => {
|
||||||
const data = new Map<string, string>()
|
const data = new Map<string, string>()
|
||||||
|
|||||||
Reference in New Issue
Block a user