mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-14 20:03:52 +00:00
feat: show welcome screen on first login
This commit is contained in:
committed by
Carlos Valente
parent
7bf90d669a
commit
22fe65c655
@@ -34,6 +34,7 @@ export class SocketServer implements IAdapter {
|
||||
private wss: WebSocketServer | null;
|
||||
private readonly clients: Map<string, Client>;
|
||||
private lastConnection: Date | null = null;
|
||||
private isFirstEditor = true;
|
||||
|
||||
constructor() {
|
||||
if (instance) {
|
||||
@@ -134,7 +135,18 @@ export class SocketServer implements IAdapter {
|
||||
const previousData = this.clients.get(clientId);
|
||||
previousData.path = payload;
|
||||
this.clients.set(clientId, previousData);
|
||||
|
||||
if (payload.includes('editor') && this.isFirstEditor) {
|
||||
this.isFirstEditor = false;
|
||||
ws.send(
|
||||
JSON.stringify({
|
||||
type: 'dialog',
|
||||
payload: { dialog: 'welcome' },
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
this.sendClientList();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user