SDA-4657: OpenFin - unregisterIntentHandler patch (#2273)

This commit is contained in:
Antoine Rollin 2025-01-27 15:00:46 +01:00 committed by GitHub
parent 599a2f3ff1
commit 17d1a6a96d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 7 additions and 5 deletions

View File

@ -673,7 +673,7 @@ describe('main api handler', () => {
const spy = jest.spyOn(openfinHandler, 'unregisterIntentHandler');
const value = {
cmd: apiCmds.openfinUnregisterIntentHandler,
intentName: 'ViewContact',
uuid: 'uuid',
};
ipcMain.send(apiName.symphonyApi, value);

View File

@ -649,7 +649,7 @@ ipcMain.handle(
case apiCmds.openfinJoinSessionContextGroup:
return openfinHandler.joinSessionContextGroup(arg.contextGroupId);
case apiCmds.openfinUnregisterIntentHandler:
return openfinHandler.unregisterIntentHandler(arg.intentName);
return openfinHandler.unregisterIntentHandler(arg.uuid);
case apiCmds.openfinFireIntentForContext:
return openfinHandler.fireIntentForContext(arg.context);
case apiCmds.openfinRemoveFromContextGroup:

View File

@ -118,10 +118,12 @@ export class OpenfinHandler {
/**
* Removes an intent handler for a given intent
*/
public unregisterIntentHandler(uuid: UUID) {
public async unregisterIntentHandler(uuid: UUID) {
const unsubscriptionCallback = this.intentHandlerSubscriptions.get(uuid);
unsubscriptionCallback.unsubscribe();
const response = await unsubscriptionCallback.unsubscribe();
this.intentHandlerSubscriptions.delete(uuid);
return response;
}
/**

View File

@ -1070,7 +1070,7 @@ export class SSFApi {
const response = await local.ipcRenderer.invoke(apiName.symphonyApi, {
cmd: apiCmds.openfinUnregisterIntentHandler,
callbackId,
uuid: callbackId,
});
return response;
}