mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
SDA-4657: OpenFin - unregisterIntentHandler patch (#2273)
This commit is contained in:
@@ -673,7 +673,7 @@ describe('main api handler', () => {
|
|||||||
const spy = jest.spyOn(openfinHandler, 'unregisterIntentHandler');
|
const spy = jest.spyOn(openfinHandler, 'unregisterIntentHandler');
|
||||||
const value = {
|
const value = {
|
||||||
cmd: apiCmds.openfinUnregisterIntentHandler,
|
cmd: apiCmds.openfinUnregisterIntentHandler,
|
||||||
intentName: 'ViewContact',
|
uuid: 'uuid',
|
||||||
};
|
};
|
||||||
|
|
||||||
ipcMain.send(apiName.symphonyApi, value);
|
ipcMain.send(apiName.symphonyApi, value);
|
||||||
|
|||||||
@@ -649,7 +649,7 @@ ipcMain.handle(
|
|||||||
case apiCmds.openfinJoinSessionContextGroup:
|
case apiCmds.openfinJoinSessionContextGroup:
|
||||||
return openfinHandler.joinSessionContextGroup(arg.contextGroupId);
|
return openfinHandler.joinSessionContextGroup(arg.contextGroupId);
|
||||||
case apiCmds.openfinUnregisterIntentHandler:
|
case apiCmds.openfinUnregisterIntentHandler:
|
||||||
return openfinHandler.unregisterIntentHandler(arg.intentName);
|
return openfinHandler.unregisterIntentHandler(arg.uuid);
|
||||||
case apiCmds.openfinFireIntentForContext:
|
case apiCmds.openfinFireIntentForContext:
|
||||||
return openfinHandler.fireIntentForContext(arg.context);
|
return openfinHandler.fireIntentForContext(arg.context);
|
||||||
case apiCmds.openfinRemoveFromContextGroup:
|
case apiCmds.openfinRemoveFromContextGroup:
|
||||||
|
|||||||
@@ -118,10 +118,12 @@ export class OpenfinHandler {
|
|||||||
/**
|
/**
|
||||||
* Removes an intent handler for a given intent
|
* Removes an intent handler for a given intent
|
||||||
*/
|
*/
|
||||||
public unregisterIntentHandler(uuid: UUID) {
|
public async unregisterIntentHandler(uuid: UUID) {
|
||||||
const unsubscriptionCallback = this.intentHandlerSubscriptions.get(uuid);
|
const unsubscriptionCallback = this.intentHandlerSubscriptions.get(uuid);
|
||||||
unsubscriptionCallback.unsubscribe();
|
|
||||||
|
const response = await unsubscriptionCallback.unsubscribe();
|
||||||
this.intentHandlerSubscriptions.delete(uuid);
|
this.intentHandlerSubscriptions.delete(uuid);
|
||||||
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1070,7 +1070,7 @@ export class SSFApi {
|
|||||||
|
|
||||||
const response = await local.ipcRenderer.invoke(apiName.symphonyApi, {
|
const response = await local.ipcRenderer.invoke(apiName.symphonyApi, {
|
||||||
cmd: apiCmds.openfinUnregisterIntentHandler,
|
cmd: apiCmds.openfinUnregisterIntentHandler,
|
||||||
callbackId,
|
uuid: callbackId,
|
||||||
});
|
});
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user