|
@@ -38,15 +38,14 @@
|
|
|
let loaded = false;
|
|
|
const BREAKPOINT = 768;
|
|
|
|
|
|
- const setupSocket = (disableWebSocketPolling) => {
|
|
|
- console.log('Disabled websocket polling', disableWebSocketPolling);
|
|
|
+ const setupSocket = (enableWebsocket) => {
|
|
|
const _socket = io(`${WEBUI_BASE_URL}` || undefined, {
|
|
|
reconnection: true,
|
|
|
reconnectionDelay: 1000,
|
|
|
reconnectionDelayMax: 5000,
|
|
|
randomizationFactor: 0.5,
|
|
|
path: '/ws/socket.io',
|
|
|
- transports: disableWebSocketPolling ? ['websocket'] : ['polling', 'websocket'],
|
|
|
+ transports: enableWebsocket ? ['websocket'] : ['polling', 'websocket'],
|
|
|
auth: { token: localStorage.token }
|
|
|
});
|
|
|
|
|
@@ -127,9 +126,8 @@
|
|
|
await config.set(backendConfig);
|
|
|
await WEBUI_NAME.set(backendConfig.name);
|
|
|
|
|
|
- const disableWebSocketPolling = backendConfig.features.disable_websocket_polling === true;
|
|
|
if ($config) {
|
|
|
- setupSocket(disableWebSocketPolling);
|
|
|
+ setupSocket($config.features?.enable_websocket ?? true);
|
|
|
|
|
|
if (localStorage.token) {
|
|
|
// Get Session User Info
|