mirror of
https://github.com/imputnet/cobalt.git
synced 2025-12-16 13:08:52 +00:00
web: add support for custom api keys & improve turnstile states
This commit is contained in:
@@ -1,4 +1,17 @@
|
||||
import { writable } from "svelte/store";
|
||||
import settings from "$lib/state/settings";
|
||||
import { cachedInfo } from "$lib/api/server-info";
|
||||
import { derived, writable } from "svelte/store";
|
||||
|
||||
export const turnstileSolved = writable(false);
|
||||
export const turnstileCreated = writable(false);
|
||||
|
||||
export const turnstileEnabled = derived(
|
||||
[settings, cachedInfo],
|
||||
([$settings, $cachedInfo]) => {
|
||||
return !!$cachedInfo?.info?.cobalt?.turnstileSitekey &&
|
||||
!(
|
||||
$settings.processing.enableCustomApiKey &&
|
||||
$settings.processing.customApiKey.length > 0
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user