mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-31 19:27:00 -06:00
SEARCH-1428 (Complete workflow of context-isolation) (#632)
* SEARCH-1313 - Completed full work flow * SEARCH-1313 - Change get-version-info to return promise * SEARCH-1313 - Bump Swift-search to 4.0.0-beta.1 to support context isolation * SEARCH-1313 - Bump Swift-search to 5.0.0-beta.2 to support context isolation * SEARCH-1313 - Rename export
This commit is contained in:
parent
6aca522a1e
commit
5cb931e31c
@ -157,6 +157,6 @@
|
|||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"screen-snippet": "git+https://github.com/symphonyoss/ScreenSnippet.git#v1.0.5",
|
"screen-snippet": "git+https://github.com/symphonyoss/ScreenSnippet.git#v1.0.5",
|
||||||
"swift-search": "5.0.0-beta.1"
|
"swift-search": "5.0.0-beta.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,7 @@ export enum apiCmds {
|
|||||||
initMainWindow = 'init-main-window',
|
initMainWindow = 'init-main-window',
|
||||||
isMisspelled = 'is-misspelled',
|
isMisspelled = 'is-misspelled',
|
||||||
memoryInfo = 'memory-info',
|
memoryInfo = 'memory-info',
|
||||||
|
swiftSearch = 'swift-search',
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum apiName {
|
export enum apiName {
|
||||||
|
@ -13,6 +13,15 @@ import { SSFApi } from './ssf-api';
|
|||||||
|
|
||||||
const ssf = new SSFApi();
|
const ssf = new SSFApi();
|
||||||
const notification = remote.require('../renderer/notification').notification;
|
const notification = remote.require('../renderer/notification').notification;
|
||||||
|
let ssInstance: any;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const SSAPIBridge = remote.require('swift-search').SSAPIBridge;
|
||||||
|
ssInstance = new SSAPIBridge();
|
||||||
|
} catch (e) {
|
||||||
|
ssInstance = null;
|
||||||
|
console.warn("Failed to initialize swift search. You'll need to include the search dependency. Contact the developers for more details");
|
||||||
|
}
|
||||||
|
|
||||||
export default class AppBridge {
|
export default class AppBridge {
|
||||||
|
|
||||||
@ -51,6 +60,9 @@ export default class AppBridge {
|
|||||||
// starts with corporate pod and
|
// starts with corporate pod and
|
||||||
// will be updated with the global config url
|
// will be updated with the global config url
|
||||||
this.origin = 'https://corporate.symphony.com';
|
this.origin = 'https://corporate.symphony.com';
|
||||||
|
if (ssInstance && typeof ssInstance.setBroadcastMessage === 'function') {
|
||||||
|
ssInstance.setBroadcastMessage(this.broadcastMessage);
|
||||||
|
}
|
||||||
window.addEventListener('message', this.callbackHandlers.onMessage);
|
window.addEventListener('message', this.callbackHandlers.onMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -129,6 +141,11 @@ export default class AppBridge {
|
|||||||
ssf.setIsInMeeting(data as boolean);
|
ssf.setIsInMeeting(data as boolean);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case apiCmds.swiftSearch:
|
||||||
|
if (ssInstance) {
|
||||||
|
ssInstance.handleMessageEvents(data);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,6 +95,24 @@ try {
|
|||||||
console.warn('Failed to initialize Crypto Lib. You\'ll need to include the Crypto library. Contact the developers for more details');
|
console.warn('Failed to initialize Crypto Lib. You\'ll need to include the Crypto library. Contact the developers for more details');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let swiftSearch: any;
|
||||||
|
try {
|
||||||
|
swiftSearch = remote.require('swift-search').Search;
|
||||||
|
} catch (e) {
|
||||||
|
swiftSearch = null;
|
||||||
|
// tslint:disable-next-line
|
||||||
|
console.warn("Failed to initialize swift search. You'll need to include the search dependency. Contact the developers for more details");
|
||||||
|
}
|
||||||
|
|
||||||
|
let swiftSearchUtils: any;
|
||||||
|
try {
|
||||||
|
swiftSearchUtils = remote.require('swift-search').SearchUtils;
|
||||||
|
} catch (e) {
|
||||||
|
swiftSearchUtils = null;
|
||||||
|
// tslint:disable-next-line
|
||||||
|
console.warn("Failed to initialize swift search utils. You'll need to include the search dependency. Contact the developers for more details");
|
||||||
|
}
|
||||||
|
|
||||||
let nextIndicatorId = 0;
|
let nextIndicatorId = 0;
|
||||||
|
|
||||||
export class SSFApi {
|
export class SSFApi {
|
||||||
@ -104,6 +122,10 @@ export class SSFApi {
|
|||||||
*/
|
*/
|
||||||
public CryptoLib: ICryptoLib | null = cryptoLib; // tslint:disable-line
|
public CryptoLib: ICryptoLib | null = cryptoLib; // tslint:disable-line
|
||||||
|
|
||||||
|
public Search: any = swiftSearch; // tslint:disable-line
|
||||||
|
|
||||||
|
public SearchUtils: any = swiftSearchUtils; // tslint:disable-line
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implements equivalent of desktopCapturer.getSources - that works in
|
* Implements equivalent of desktopCapturer.getSources - that works in
|
||||||
* a sandboxed renderer process.
|
* a sandboxed renderer process.
|
||||||
|
Loading…
Reference in New Issue
Block a user