mirror of
https://github.com/KuekHaoYang/KVideo.git
synced 2026-08-22 04:03:42 +08:00
docker弹幕环境变量修复
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user