From 8e977900ab574f1db85db1971179ec1edd8f5454 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 8 Jun 2024 00:32:49 +0530 Subject: [PATCH] feat: notify client of url change --- .../src/workflow-management/classes/Generator.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/server/src/workflow-management/classes/Generator.ts b/server/src/workflow-management/classes/Generator.ts index 557b37ca..87b597d5 100644 --- a/server/src/workflow-management/classes/Generator.ts +++ b/server/src/workflow-management/classes/Generator.ts @@ -488,5 +488,17 @@ export class WorkflowGenerator { } } - -} + /** + * Notifies the client about the change of the url if navigation + * happens after some performed action. + * @param url The new url. + * @param fromNavBar Whether the navigation is from the simulated browser's navbar or not. + * @returns void + */ + public notifyUrlChange = (url:string) => { + if (this.socket) { + this.socket.emit('urlChanged', url); + } + } + +} \ No newline at end of file