Fix danmaku auto-load default toggle

This commit is contained in:
ShiGuangAlex
2026-04-14 22:21:42 +08:00
parent 42975aeb1a
commit aa5426c186
2 changed files with 7 additions and 2 deletions
+2 -2
View File
@@ -8557,10 +8557,10 @@ const SiteConfigComponent = ({
type='checkbox'
className='sr-only peer'
checked={siteSettings.DanmakuAutoLoadDefault !== false}
onChange={() =>
onChange={(e) =>
setSiteSettings((prev) => ({
...prev,
DanmakuAutoLoadDefault: prev.DanmakuAutoLoadDefault === false,
DanmakuAutoLoadDefault: e.target.checked,
}))
}
/>
+5
View File
@@ -42,6 +42,7 @@ export async function POST(request: NextRequest) {
DanmakuSourceType,
DanmakuApiBase,
DanmakuApiToken,
DanmakuAutoLoadDefault,
TMDBApiKey,
TMDBProxy,
TMDBReverseProxy,
@@ -90,6 +91,7 @@ export async function POST(request: NextRequest) {
DanmakuSourceType?: 'builtin' | 'custom';
DanmakuApiBase: string;
DanmakuApiToken: string;
DanmakuAutoLoadDefault?: boolean;
TMDBApiKey?: string;
TMDBProxy?: string;
TMDBReverseProxy?: string;
@@ -143,6 +145,8 @@ export async function POST(request: NextRequest) {
DanmakuSourceType !== 'custom') ||
typeof DanmakuApiBase !== 'string' ||
typeof DanmakuApiToken !== 'string' ||
(DanmakuAutoLoadDefault !== undefined &&
typeof DanmakuAutoLoadDefault !== 'boolean') ||
(TMDBApiKey !== undefined && typeof TMDBApiKey !== 'string') ||
(TMDBProxy !== undefined && typeof TMDBProxy !== 'string') ||
(TMDBReverseProxy !== undefined && typeof TMDBReverseProxy !== 'string') ||
@@ -203,6 +207,7 @@ export async function POST(request: NextRequest) {
DanmakuSourceType,
DanmakuApiBase,
DanmakuApiToken,
DanmakuAutoLoadDefault,
TMDBApiKey,
TMDBProxy,
TMDBReverseProxy,