From 92dfd41e584ff14ac4a2ae3cd0876ccd79c0e493 Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Thu, 24 Sep 2020 11:24:31 +0200 Subject: [PATCH] Moved the connection handler --- shared/js/ConnectionHandler.ts | 2 +- .../connection_handlers.ts => ConnectionManager.ts} | 13 +++++++------ shared/js/KeyControl.ts | 2 +- shared/js/bookmarks.ts | 2 +- shared/js/connection/CommandHandler.ts | 2 +- shared/js/connection/HandshakeHandler.ts | 1 - shared/js/events/ClientGlobalControlHandler.ts | 2 +- shared/js/file/Icons.tsx | 2 +- shared/js/file/LocalAvatars.ts | 2 +- shared/js/main.tsx | 8 ++++---- shared/js/text/bbcode/youtube.tsx | 2 +- shared/js/tree/Server.ts | 2 +- shared/js/ui/frames/ConnectionList.scss | 0 shared/js/ui/frames/ConnectionList.tsx | 0 shared/js/ui/frames/MenuBar.ts | 4 +--- shared/js/ui/frames/control-bar/index.tsx | 2 +- shared/js/ui/frames/log/DispatcherNotifications.ts | 2 +- shared/js/ui/htmltags.ts | 2 +- shared/js/ui/modal/ModalConnect.ts | 2 +- shared/js/ui/modal/ModalSettings.tsx | 2 +- .../ui/modal/global-settings-editor/Controller.tsx | 1 + .../ui/modal/permission/ModalPermissionEditor.tsx | 4 ---- shared/js/ui/modal/transfer/ModalFileTransfer.tsx | 2 +- shared/js/video-viewer/Controller.ts | 2 +- web/app/UnloadHandler.ts | 2 +- 25 files changed, 30 insertions(+), 35 deletions(-) rename shared/js/{ui/frames/connection_handlers.ts => ConnectionManager.ts} (96%) create mode 100644 shared/js/ui/frames/ConnectionList.scss create mode 100644 shared/js/ui/frames/ConnectionList.tsx diff --git a/shared/js/ConnectionHandler.ts b/shared/js/ConnectionHandler.ts index e2f0706a..2ddbf0b3 100644 --- a/shared/js/ConnectionHandler.ts +++ b/shared/js/ConnectionHandler.ts @@ -15,7 +15,6 @@ import {CommandResult} from "./connection/ServerConnectionDeclaration"; import {defaultRecorder, RecorderProfile} from "./voice/RecorderProfile"; import {Frame} from "./ui/frames/chat_frame"; import {Hostbanner} from "./ui/frames/hostbanner"; -import {server_connections} from "./ui/frames/connection_handlers"; import {connection_log, Regex} from "./ui/modal/ModalConnect"; import {formatMessage} from "./ui/frames/chat"; import {spawnAvatarUpload} from "./ui/modal/ModalAvatar"; @@ -38,6 +37,7 @@ import {ServerFeature, ServerFeatures} from "./connection/ServerFeatures"; import {ChannelTree} from "./tree/ChannelTree"; import {LocalClientEntry} from "./tree/Client"; import {ServerAddress} from "./tree/Server"; +import {server_connections} from "tc-shared/ConnectionManager"; export enum InputHardwareState { MISSING, diff --git a/shared/js/ui/frames/connection_handlers.ts b/shared/js/ConnectionManager.ts similarity index 96% rename from shared/js/ui/frames/connection_handlers.ts rename to shared/js/ConnectionManager.ts index 629f286f..944febd5 100644 --- a/shared/js/ui/frames/connection_handlers.ts +++ b/shared/js/ConnectionManager.ts @@ -1,10 +1,10 @@ -import {ConnectionHandler, DisconnectReason} from "../../ConnectionHandler"; -import {Settings, settings} from "../../settings"; -import * as top_menu from "./MenuBar"; -import {Registry} from "../../events"; +import {ConnectionHandler, DisconnectReason} from "./ConnectionHandler"; +import {Settings, settings} from "./settings"; +import {Registry} from "./events"; +import * as top_menu from "./ui/frames/MenuBar"; export let server_connections: ConnectionManager; -export function initialize() { +export function initializeServerConnections() { if(server_connections) throw tr("Connection manager has already been initialized"); server_connections = new ConnectionManager($("#connection-handlers")); } @@ -30,8 +30,9 @@ export class ConnectionManager { this._tag = tag; - if(settings.static_global(Settings.KEY_DISABLE_MULTI_SESSION, false)) + if(settings.static_global(Settings.KEY_DISABLE_MULTI_SESSION, false)) { this._tag.hide(); + } this._tag_connection_entries = this._tag.find(".connection-handlers"); this._tag_buttons_scoll = this._tag.find(".container-scroll"); diff --git a/shared/js/KeyControl.ts b/shared/js/KeyControl.ts index 8a66e13c..08819685 100644 --- a/shared/js/KeyControl.ts +++ b/shared/js/KeyControl.ts @@ -1,9 +1,9 @@ -import {server_connections} from "./ui/frames/connection_handlers"; import {EventType, KeyDescriptor, KeyEvent, KeyHook} from "./PPTListener"; import * as ppt from "tc-backend/ppt"; import {Settings, settings} from "./settings"; import * as log from "./log"; import {LogCategory} from "./log"; +import {server_connections} from "tc-shared/ConnectionManager"; export interface KeyControl { category: string; diff --git a/shared/js/bookmarks.ts b/shared/js/bookmarks.ts index cb5f2b58..8971d2dd 100644 --- a/shared/js/bookmarks.ts +++ b/shared/js/bookmarks.ts @@ -3,11 +3,11 @@ import {LogCategory} from "./log"; import {guid} from "./crypto/uid"; import {createErrorModal, createInfoModal, createInputModal} from "./ui/elements/Modal"; import {defaultConnectProfile, findConnectProfile} from "./profiles/ConnectionProfile"; -import {server_connections} from "./ui/frames/connection_handlers"; import {spawnConnectModal} from "./ui/modal/ModalConnect"; import * as top_menu from "./ui/frames/MenuBar"; import {control_bar_instance} from "./ui/frames/control-bar"; import {ConnectionHandler} from "./ConnectionHandler"; +import {server_connections} from "tc-shared/ConnectionManager"; export const boorkmak_connect = (mark: Bookmark, new_tab?: boolean) => { const profile = findConnectProfile(mark.connect_profile) || defaultConnectProfile(); diff --git a/shared/js/connection/CommandHandler.ts b/shared/js/connection/CommandHandler.ts index 4adc1d9e..d775aac6 100644 --- a/shared/js/connection/CommandHandler.ts +++ b/shared/js/connection/CommandHandler.ts @@ -15,7 +15,6 @@ import { import {ChannelEntry} from "../tree/Channel"; import {ConnectionHandler, ConnectionState, DisconnectReason, ViewReasonId} from "../ConnectionHandler"; import {formatMessage} from "../ui/frames/chat"; -import {server_connections} from "../ui/frames/connection_handlers"; import {spawnPoke} from "../ui/modal/ModalPoke"; import {AbstractCommandHandler, AbstractCommandHandlerBoss} from "../connection/AbstractCommandHandler"; import {batch_updates, BatchUpdateType, flush_batched_updates} from "../ui/react-elements/ReactComponentBase"; @@ -24,6 +23,7 @@ import {renderBBCodeAsJQuery} from "../text/bbcode"; import {tr} from "../i18n/localize"; import {EventClient, EventType} from "../ui/frames/log/Definitions"; import {ErrorCode} from "../connection/ErrorCode"; +import {server_connections} from "tc-shared/ConnectionManager"; export class ServerConnectionCommandBoss extends AbstractCommandHandlerBoss { constructor(connection: AbstractServerConnection) { diff --git a/shared/js/connection/HandshakeHandler.ts b/shared/js/connection/HandshakeHandler.ts index 9190168c..5a95cebf 100644 --- a/shared/js/connection/HandshakeHandler.ts +++ b/shared/js/connection/HandshakeHandler.ts @@ -3,7 +3,6 @@ import {IdentitifyType} from "../profiles/Identity"; import {TeaSpeakIdentity} from "../profiles/identities/TeamSpeakIdentity"; import {AbstractServerConnection} from "../connection/ConnectionBase"; import {ConnectionProfile} from "../profiles/ConnectionProfile"; -import {settings} from "../settings"; import {ConnectParameters, DisconnectReason} from "../ConnectionHandler"; import {tr} from "../i18n/localize"; diff --git a/shared/js/events/ClientGlobalControlHandler.ts b/shared/js/events/ClientGlobalControlHandler.ts index f8c339d0..835aee7c 100644 --- a/shared/js/events/ClientGlobalControlHandler.ts +++ b/shared/js/events/ClientGlobalControlHandler.ts @@ -2,7 +2,6 @@ import {Registry} from "../events"; import {ClientGlobalControlEvents} from "../events/GlobalEvents"; import {Sound} from "../sound/Sounds"; import {ConnectionHandler} from "../ConnectionHandler"; -import {server_connections} from "../ui/frames/connection_handlers"; import {createErrorModal, createInfoModal, createInputModal} from "../ui/elements/Modal"; import {spawnConnectModal} from "../ui/modal/ModalConnect"; import PermissionType from "../permission/PermissionType"; @@ -15,6 +14,7 @@ import {spawnPermissionEditorModal} from "../ui/modal/permission/ModalPermission import {tr} from "../i18n/localize"; import {spawnGlobalSettingsEditor} from "tc-shared/ui/modal/global-settings-editor/Controller"; import {spawnModalCssVariableEditor} from "tc-shared/ui/modal/css-editor/Controller"; +import {server_connections} from "tc-shared/ConnectionManager"; /* function initialize_sounds(event_registry: Registry) { diff --git a/shared/js/file/Icons.tsx b/shared/js/file/Icons.tsx index 4a4fb14b..ed2b3224 100644 --- a/shared/js/file/Icons.tsx +++ b/shared/js/file/Icons.tsx @@ -10,9 +10,9 @@ import { FileTransferState, ResponseTransferTarget, TransferProvider, TransferTargetType } from "tc-shared/file/Transfer"; -import {server_connections} from "tc-shared/ui/frames/connection_handlers"; import {tr} from "tc-shared/i18n/localize"; import {ErrorCode} from "tc-shared/connection/ErrorCode"; +import {server_connections} from "tc-shared/ConnectionManager"; const icon_cache: ImageCache = new ImageCache("icons"); export interface IconManagerEvents { diff --git a/shared/js/file/LocalAvatars.ts b/shared/js/file/LocalAvatars.ts index 1295880d..b8b45b84 100644 --- a/shared/js/file/LocalAvatars.ts +++ b/shared/js/file/LocalAvatars.ts @@ -14,7 +14,6 @@ import { TransferTargetType } from "../file/Transfer"; import {CommandResult} from "../connection/ServerConnectionDeclaration"; -import {server_connections} from "../ui/frames/connection_handlers"; import {ClientEntry} from "../tree/Client"; import {tr} from "../i18n/localize"; import { @@ -30,6 +29,7 @@ import { import {IPCChannel} from "../ipc/BrowserIPC"; import {ConnectionHandler} from "../ConnectionHandler"; import {ErrorCode} from "../connection/ErrorCode"; +import {server_connections} from "tc-shared/ConnectionManager"; /* FIXME: Retry avatar download after some time! */ diff --git a/shared/js/main.tsx b/shared/js/main.tsx index f89ae11a..71195787 100644 --- a/shared/js/main.tsx +++ b/shared/js/main.tsx @@ -11,8 +11,6 @@ import {createInfoModal} from "tc-shared/ui/elements/Modal"; import * as stats from "./stats"; import * as fidentity from "./profiles/identities/TeaForumIdentity"; import {defaultRecorder, RecorderProfile, setDefaultRecorder} from "tc-shared/voice/RecorderProfile"; -import * as cmanager from "tc-shared/ui/frames/connection_handlers"; -import {server_connections} from "tc-shared/ui/frames/connection_handlers"; import {spawnConnectModal} from "tc-shared/ui/modal/ModalConnect"; import * as top_menu from "./ui/frames/MenuBar"; import {spawnYesNo} from "tc-shared/ui/modal/ModalYesNo"; @@ -47,6 +45,7 @@ import "./update/UpdaterWeb"; import ContextMenuEvent = JQuery.ContextMenuEvent; import {defaultConnectProfile, findConnectProfile} from "tc-shared/profiles/ConnectionProfile"; import {spawnGlobalSettingsEditor} from "tc-shared/ui/modal/global-settings-editor/Controller"; +import {initializeServerConnections, server_connections} from "tc-shared/ConnectionManager"; let preventWelcomeUI = false; async function initialize() { @@ -74,7 +73,8 @@ async function initialize_app() { loader.critical_error(tr("Failed to setup main page!")); return; } - cmanager.initialize(); + + initializeServerConnections(); global_ev_handler.initialize(global_client_actions); { const bar = ( @@ -200,7 +200,7 @@ function main() { const initial_handler = server_connections.spawn_server_connection(); initial_handler.acquireInputHardware().then(() => {}); - cmanager.server_connections.set_active_connection(initial_handler); + server_connections.set_active_connection(initial_handler); /** Setup the XF forum identity **/ fidentity.update_forum(); keycontrol.initialize(); diff --git a/shared/js/text/bbcode/youtube.tsx b/shared/js/text/bbcode/youtube.tsx index 9635cd90..b1c343b9 100644 --- a/shared/js/text/bbcode/youtube.tsx +++ b/shared/js/text/bbcode/youtube.tsx @@ -8,8 +8,8 @@ import {HTMLRenderer} from "tc-shared/ui/react-elements/HTMLRenderer"; import * as contextmenu from "tc-shared/ui/elements/ContextMenu"; import {spawn_context_menu} from "tc-shared/ui/elements/ContextMenu"; import {copy_to_clipboard} from "tc-shared/utils/helpers"; -import {server_connections} from "tc-shared/ui/frames/connection_handlers"; import {global_client_actions} from "tc-shared/events/GlobalEvents"; +import {server_connections} from "tc-shared/ConnectionManager"; const playIcon = require("./yt-play-button.svg"); const cssStyle = require("./youtube.scss"); diff --git a/shared/js/tree/Server.ts b/shared/js/tree/Server.ts index 1d01a05b..d970906d 100644 --- a/shared/js/tree/Server.ts +++ b/shared/js/tree/Server.ts @@ -10,7 +10,6 @@ import {openServerInfo} from "../ui/modal/ModalServerInfo"; import {createServerModal} from "../ui/modal/ModalServerEdit"; import {spawnIconSelect} from "../ui/modal/ModalIconSelect"; import {spawnAvatarList} from "../ui/modal/ModalAvatarList"; -import {server_connections} from "../ui/frames/connection_handlers"; import {connection_log} from "../ui/modal/ModalConnect"; import * as top_menu from "../ui/frames/MenuBar"; import {control_bar_instance} from "../ui/frames/control-bar"; @@ -18,6 +17,7 @@ import { ServerEntry as ServerEntryView } from "../ui/tree/Server"; import * as React from "react"; import {Registry} from "../events"; import {ChannelTreeEntry, ChannelTreeEntryEvents} from "./ChannelTreeEntry"; +import {server_connections} from "tc-shared/ConnectionManager"; export class ServerProperties { virtualserver_host: string = ""; diff --git a/shared/js/ui/frames/ConnectionList.scss b/shared/js/ui/frames/ConnectionList.scss new file mode 100644 index 00000000..e69de29b diff --git a/shared/js/ui/frames/ConnectionList.tsx b/shared/js/ui/frames/ConnectionList.tsx new file mode 100644 index 00000000..e69de29b diff --git a/shared/js/ui/frames/MenuBar.ts b/shared/js/ui/frames/MenuBar.ts index 17b0f7b0..beb6288b 100644 --- a/shared/js/ui/frames/MenuBar.ts +++ b/shared/js/ui/frames/MenuBar.ts @@ -16,16 +16,14 @@ import {PermissionType} from "../../permission/PermissionType"; import {openBanList} from "../../ui/modal/ModalBanList"; import {spawnQueryManage} from "../../ui/modal/ModalQueryManage"; import {spawnQueryCreate} from "../../ui/modal/ModalQuery"; -import {spawnSettingsModal} from "../../ui/modal/ModalSettings"; import {spawnAbout} from "../../ui/modal/ModalAbout"; -import {server_connections} from "../../ui/frames/connection_handlers"; import * as loader from "tc-loader"; import {formatMessage} from "../../ui/frames/chat"; import {control_bar_instance} from "../../ui/frames/control-bar"; import {icon_cache_loader, IconManager, LocalIcon} from "../../file/Icons"; import {spawnPermissionEditorModal} from "../../ui/modal/permission/ModalPermissionEditor"; -import {spawnModalCssVariableEditor} from "../../ui/modal/css-editor/Controller"; import {global_client_actions} from "tc-shared/events/GlobalEvents"; +import {server_connections} from "tc-shared/ConnectionManager"; export interface HRItem { } diff --git a/shared/js/ui/frames/control-bar/index.tsx b/shared/js/ui/frames/control-bar/index.tsx index f45ddd78..3a3fdca1 100644 --- a/shared/js/ui/frames/control-bar/index.tsx +++ b/shared/js/ui/frames/control-bar/index.tsx @@ -9,7 +9,6 @@ import { ConnectionStateUpdateType } from "tc-shared/ConnectionHandler"; import {Event, EventHandler, ReactEventHandler, Registry} from "tc-shared/events"; -import {ConnectionManagerEvents, server_connections} from "tc-shared/ui/frames/connection_handlers"; import {Settings, settings} from "tc-shared/settings"; import { add_server_to_bookmarks, @@ -24,6 +23,7 @@ import * as contextmenu from "tc-shared/ui/elements/ContextMenu"; import {createInputModal} from "tc-shared/ui/elements/Modal"; import {global_client_actions} from "tc-shared/events/GlobalEvents"; import {icon_cache_loader} from "tc-shared/file/Icons"; +import {ConnectionManagerEvents, server_connections} from "tc-shared/ConnectionManager"; const cssStyle = require("./index.scss"); const cssButtonStyle = require("./button.scss"); diff --git a/shared/js/ui/frames/log/DispatcherNotifications.ts b/shared/js/ui/frames/log/DispatcherNotifications.ts index 4c4fc67e..aadd0040 100644 --- a/shared/js/ui/frames/log/DispatcherNotifications.ts +++ b/shared/js/ui/frames/log/DispatcherNotifications.ts @@ -3,13 +3,13 @@ import {Stage} from "tc-loader"; import * as log from "../../../log"; import {LogCategory} from "../../../log"; import {EventClient, EventServerAddress, EventType, TypeInfo} from "../../../ui/frames/log/Definitions"; -import {server_connections} from "../../../ui/frames/connection_handlers"; import {renderBBCodeAsText} from "../../../text/bbcode"; import {format_time} from "../../../ui/frames/chat"; import {ViewReasonId} from "../../../ConnectionHandler"; import {findLogDispatcher} from "../../../ui/frames/log/DispatcherLog"; import {formatDate} from "../../../MessageFormatter"; import {Settings, settings} from "../../../settings"; +import {server_connections} from "tc-shared/ConnectionManager"; export type DispatcherLog = (data: TypeInfo[T], handlerId: string, eventType: T) => void; diff --git a/shared/js/ui/htmltags.ts b/shared/js/ui/htmltags.ts index 9367bdbe..48a47a3a 100644 --- a/shared/js/ui/htmltags.ts +++ b/shared/js/ui/htmltags.ts @@ -3,8 +3,8 @@ import {LogCategory} from "../log"; import {ChannelEntry} from "../tree/Channel"; import {ClientEntry} from "../tree/Client"; import {htmlEscape} from "../ui/frames/chat"; -import {server_connections} from "../ui/frames/connection_handlers"; import {guid} from "../crypto/uid"; +import {server_connections} from "tc-shared/ConnectionManager"; let mouse_coordinates: {x: number, y: number} = {x: 0, y: 0}; diff --git a/shared/js/ui/modal/ModalConnect.ts b/shared/js/ui/modal/ModalConnect.ts index 75f885cc..c596b006 100644 --- a/shared/js/ui/modal/ModalConnect.ts +++ b/shared/js/ui/modal/ModalConnect.ts @@ -7,8 +7,8 @@ import {ConnectionProfile, defaultConnectProfile, findConnectProfile, availableC import {KeyCode} from "../../PPTListener"; import * as i18nc from "../../i18n/country"; import {spawnSettingsModal} from "../../ui/modal/ModalSettings"; -import {server_connections} from "../../ui/frames/connection_handlers"; import {icon_cache_loader, IconManager} from "../../file/Icons"; +import {server_connections} from "tc-shared/ConnectionManager"; //FIXME: Move this shit out of this file! export namespace connection_log { diff --git a/shared/js/ui/modal/ModalSettings.tsx b/shared/js/ui/modal/ModalSettings.tsx index 8aa08999..dcde6deb 100644 --- a/shared/js/ui/modal/ModalSettings.tsx +++ b/shared/js/ui/modal/ModalSettings.tsx @@ -17,7 +17,6 @@ import * as events from "tc-shared/events"; import {Registry} from "tc-shared/events"; import {spawnYesNo} from "tc-shared/ui/modal/ModalYesNo"; import * as i18nc from "tc-shared/i18n/country"; -import {server_connections} from "tc-shared/ui/frames/connection_handlers"; import * as forum from "tc-shared/profiles/identities/teaspeak-forum"; import {formatMessage, set_icon_size} from "tc-shared/ui/frames/chat"; import {spawnTeamSpeakIdentityImport, spawnTeamSpeakIdentityImprove} from "tc-shared/ui/modal/ModalIdentity"; @@ -29,6 +28,7 @@ import * as ReactDOM from "react-dom"; import {NotificationSettings} from "tc-shared/ui/modal/settings/Notifications"; import {initialize_audio_microphone_controller, MicrophoneSettingsEvents} from "tc-shared/ui/modal/settings/Microphone"; import {MicrophoneSettings} from "tc-shared/ui/modal/settings/MicrophoneRenderer"; +import {server_connections} from "tc-shared/ConnectionManager"; export function spawnSettingsModal(default_page?: string): Modal { let modal: Modal; diff --git a/shared/js/ui/modal/global-settings-editor/Controller.tsx b/shared/js/ui/modal/global-settings-editor/Controller.tsx index 5a2924b7..b77a5542 100644 --- a/shared/js/ui/modal/global-settings-editor/Controller.tsx +++ b/shared/js/ui/modal/global-settings-editor/Controller.tsx @@ -3,6 +3,7 @@ import {ModalGlobalSettingsEditor} from "tc-shared/ui/modal/global-settings-edit import {Registry} from "tc-shared/events"; import {ModalGlobalSettingsEditorEvents, Setting} from "tc-shared/ui/modal/global-settings-editor/Definitions"; import {ConfigValueTypes, settings, Settings, SettingsKey} from "tc-shared/settings"; +import {key} from "tc-shared/KeyControl"; export function spawnGlobalSettingsEditor() { const events = new Registry(); diff --git a/shared/js/ui/modal/permission/ModalPermissionEditor.tsx b/shared/js/ui/modal/permission/ModalPermissionEditor.tsx index 77fa4e73..eaa574dd 100644 --- a/shared/js/ui/modal/permission/ModalPermissionEditor.tsx +++ b/shared/js/ui/modal/permission/ModalPermissionEditor.tsx @@ -3,7 +3,6 @@ import {ConnectionHandler} from "tc-shared/ConnectionHandler"; import * as React from "react"; import {useState} from "react"; import {ContextDivider} from "tc-shared/ui/react-elements/ContextDivider"; -import {server_connections} from "tc-shared/ui/frames/connection_handlers"; import {Translatable} from "tc-shared/ui/react-elements/i18n"; import {Registry} from "tc-shared/events"; import { @@ -348,9 +347,6 @@ export function spawnPermissionEditorModal(connection: ConnectionHandler, defaul modal.show(); } -const spawn = () => spawnPermissionEditorModal(server_connections.active_connection()); -(window as any).spawn_permissions = spawn; - function initializePermissionModalResultHandlers(events: Registry) { events.on("action_rename_group_result", event => { if (event.status === "error") { diff --git a/shared/js/ui/modal/transfer/ModalFileTransfer.tsx b/shared/js/ui/modal/transfer/ModalFileTransfer.tsx index b555be2d..25930131 100644 --- a/shared/js/ui/modal/transfer/ModalFileTransfer.tsx +++ b/shared/js/ui/modal/transfer/ModalFileTransfer.tsx @@ -2,7 +2,6 @@ import {spawnReactModal} from "tc-shared/ui/react-elements/Modal"; import * as React from "react"; import {FileType} from "tc-shared/file/FileManager"; import {Registry} from "tc-shared/events"; -import {server_connections} from "tc-shared/ui/frames/connection_handlers"; import {FileBrowser, NavigationBar} from "tc-shared/ui/modal/transfer/FileBrowser"; import {TransferInfo, TransferInfoEvents} from "tc-shared/ui/modal/transfer/TransferInfo"; import {initializeRemoteFileBrowserController} from "tc-shared/ui/modal/transfer/RemoteFileBrowserController"; @@ -10,6 +9,7 @@ import {ChannelEntry} from "tc-shared/tree/Channel"; import {initializeTransferInfoController} from "tc-shared/ui/modal/transfer/TransferInfoController"; import {Translatable} from "tc-shared/ui/react-elements/i18n"; import {InternalModal} from "tc-shared/ui/react-elements/internal-modal/Controller"; +import {server_connections} from "tc-shared/ConnectionManager"; const cssStyle = require("./ModalFileTransfer.scss"); export const channelPathPrefix = tr("Channel") + " "; diff --git a/shared/js/video-viewer/Controller.ts b/shared/js/video-viewer/Controller.ts index 0dbe3fd6..928e197f 100644 --- a/shared/js/video-viewer/Controller.ts +++ b/shared/js/video-viewer/Controller.ts @@ -7,9 +7,9 @@ import {ConnectionHandler} from "../ConnectionHandler"; import {W2GPluginCmdHandler, W2GWatcher, W2GWatcherFollower} from "../video-viewer/W2GPlugin"; import {settings, Settings} from "../settings"; import {global_client_actions} from "../events/GlobalEvents"; -import {server_connections} from "../ui/frames/connection_handlers"; import {createErrorModal} from "../ui/elements/Modal"; import {ModalController} from "../ui/react-elements/ModalDefinitions"; +import {server_connections} from "tc-shared/ConnectionManager"; const parseWatcherId = (id: string): { clientId: number, clientUniqueId: string} => { const [ clientIdString, clientUniqueId ] = id.split(" - "); diff --git a/web/app/UnloadHandler.ts b/web/app/UnloadHandler.ts index b0a25f12..5ce49b77 100644 --- a/web/app/UnloadHandler.ts +++ b/web/app/UnloadHandler.ts @@ -1,5 +1,5 @@ import {Settings, settings} from "tc-shared/settings"; -import {server_connections} from "tc-shared/ui/frames/connection_handlers"; +import {server_connections} from "tc-shared/ConnectionManager"; window.addEventListener("beforeunload", event => { if(settings.static(Settings.KEY_DISABLE_UNLOAD_DIALOG))