docker弹幕环境变量修复

This commit is contained in:
mayziran
2026-03-26 15:23:43 +08:00
parent 91a89e8bf2
commit 91bb481c4e
3 changed files with 23 additions and 3 deletions
+18
View File
@@ -53,6 +53,20 @@ function syncMergeSources(rawValue: string) {
}
}
function syncDanmakuApiUrl(rawValue: string) {
if (!rawValue) return;
const buildTimeValue = process.env.NEXT_PUBLIC_DANMAKU_API_URL || '';
const settings = settingsStore.getSettings();
if (!settings.danmakuApiUrl || settings.danmakuApiUrl === buildTimeValue) {
settingsStore.saveSettings({
...settings,
danmakuApiUrl: rawValue,
});
}
}
export function PasswordGate({ children, hasAuth: initialHasAuth }: { children: React.ReactNode, hasAuth: boolean }) {
// Enable background subscription syncing globally
useSubscriptionSync();
@@ -106,6 +120,10 @@ export function PasswordGate({ children, hasAuth: initialHasAuth }: { children:
syncMergeSources(data.mergeSources);
}
if (data.danmakuApiUrl) {
syncDanmakuApiUrl(data.danmakuApiUrl);
}
// Re-evaluate lock status with confirmed server state
const confirmLocked = data.hasAuth && !isAuthenticated;
setIsLocked(confirmLocked);