more fixes for plugins
This commit is contained in:
@@ -530,6 +530,7 @@ async function startServer() {
|
||||
sendHVNCCommand,
|
||||
notifyConsoleClosed,
|
||||
clearPendingNotificationScreenshots: notificationPluginHandlers.clearPendingNotificationScreenshots,
|
||||
clearClientPluginState: notificationPluginHandlers.clearClientPluginState,
|
||||
notifyRemoteDesktopStatus,
|
||||
handleBuildTagConnection,
|
||||
notifyDashboard: sessionManager.notifyDashboardViewers,
|
||||
|
||||
@@ -85,6 +85,7 @@ type WsLifecycleDeps = {
|
||||
sendHVNCCommand: (target: ClientInfo, commandType: string, payload: Record<string, unknown>) => void;
|
||||
notifyConsoleClosed: (clientId: string, reason: string) => void;
|
||||
clearPendingNotificationScreenshots: (clientId: string) => void;
|
||||
clearClientPluginState: (clientId: string) => void;
|
||||
notifyRemoteDesktopStatus: (clientId: string, status: string, reason?: string) => void;
|
||||
handleBuildTagConnection: (clientId: string, buildTag: string) => void;
|
||||
notifyDashboard: () => void;
|
||||
@@ -714,6 +715,7 @@ export function handleWebSocketClose(
|
||||
deps.notifyConsoleClosed(clientId, "Client disconnected");
|
||||
setOnlineState(clientId, false);
|
||||
deps.clearPendingNotificationScreenshots(clientId);
|
||||
deps.clearClientPluginState(clientId);
|
||||
deps.notifyDashboard();
|
||||
logger.info(`[close] ${clientId} code=${code} reason=${reason}`);
|
||||
|
||||
|
||||
@@ -358,6 +358,11 @@ export function createNotificationPluginHandlers(deps: CreateDeps) {
|
||||
|
||||
markPluginLoaded,
|
||||
|
||||
clearClientPluginState(clientId: string) {
|
||||
deps.pluginLoadedByClient.delete(clientId);
|
||||
deps.pluginLoadingByClient.delete(clientId);
|
||||
},
|
||||
|
||||
isPluginLoaded(clientId: string, pluginId: string): boolean {
|
||||
return deps.pluginLoadedByClient.get(clientId)?.has(pluginId) ?? false;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user