mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-27 17:31:36 -06:00
SDA-1995: refactor function names
Signed-off-by: Vishwas Shashidhar <vishwas.shashidhar@symphony.com>
This commit is contained in:
parent
8f518e3936
commit
c9d0260ff1
@ -866,7 +866,7 @@
|
||||
}
|
||||
const id = items[items.length - 1].id;
|
||||
if (window.ssf) {
|
||||
window.ssf.openDownloadItem(id);
|
||||
window.ssf.openDownloadedItem(id);
|
||||
} else {
|
||||
postMessage(apiCmds.openDownloadItem, id);
|
||||
}
|
||||
@ -878,7 +878,7 @@
|
||||
}
|
||||
const id = items[items.length - 1].id;
|
||||
if (window.ssf) {
|
||||
window.ssf.showDownloadItem(id);
|
||||
window.ssf.showDownloadedItem(id);
|
||||
} else {
|
||||
postMessage(apiCmds.showDownloadItem, id);
|
||||
}
|
||||
@ -887,7 +887,7 @@
|
||||
document.getElementById('close-download-manager').addEventListener('click', () => {
|
||||
items = [];
|
||||
if (window.ssf) {
|
||||
window.ssf.clearDownloadItems();
|
||||
window.ssf.clearDownloadedItems();
|
||||
} else {
|
||||
postMessage(apiCmds.clearDownloadItems);
|
||||
}
|
||||
|
@ -111,16 +111,16 @@ export class AppBridge {
|
||||
break;
|
||||
case apiCmds.openDownloadItem:
|
||||
if (typeof data === 'string') {
|
||||
ssf.openDownloadItem(data as string);
|
||||
ssf.openDownloadedItem(data as string);
|
||||
}
|
||||
break;
|
||||
case apiCmds.showDownloadItem:
|
||||
if (typeof data === 'string') {
|
||||
ssf.showDownloadItem(data as string);
|
||||
ssf.showDownloadedItem(data as string);
|
||||
}
|
||||
break;
|
||||
case apiCmds.clearDownloadItems:
|
||||
ssf.clearDownloadItems();
|
||||
ssf.clearDownloadedItems();
|
||||
break;
|
||||
case apiCmds.setLocale:
|
||||
if (typeof data === 'string') {
|
||||
|
@ -59,6 +59,9 @@ if (ssfWindow.ssf) {
|
||||
getVersionInfo: ssfWindow.ssf.getVersionInfo,
|
||||
registerActivityDetection: ssfWindow.ssf.registerActivityDetection,
|
||||
registerDownloadHandler: ssfWindow.ssf.registerDownloadHandler,
|
||||
openDownloadedItem: ssfWindow.ssf.openDownloadedItem,
|
||||
showDownloadedItem: ssfWindow.ssf.showDownloadedItem,
|
||||
clearDownloadedItems: ssfWindow.ssf.clearDownloadedItems,
|
||||
registerBoundsChange: ssfWindow.ssf.registerBoundsChange,
|
||||
registerLogger: ssfWindow.ssf.registerLogger,
|
||||
registerProtocolHandler: ssfWindow.ssf.registerProtocolHandler,
|
||||
|
@ -102,21 +102,21 @@ const throttledSetCloudConfig = throttle((data) => {
|
||||
});
|
||||
}, 1000);
|
||||
|
||||
const throttledOpenDownloadItem = throttle((id: string) => {
|
||||
const throttledOpenDownloadedItem = throttle((id: string) => {
|
||||
ipcRenderer.send(apiName.symphonyApi, {
|
||||
cmd: apiCmds.openDownloadItem,
|
||||
id,
|
||||
});
|
||||
}, 1000);
|
||||
|
||||
const throttledShowDownloadItem = throttle((id: string) => {
|
||||
const throttledShowDownloadedItem = throttle((id: string) => {
|
||||
ipcRenderer.send(apiName.symphonyApi, {
|
||||
cmd: apiCmds.showDownloadItem,
|
||||
id,
|
||||
});
|
||||
}, 1000);
|
||||
|
||||
const throttledClearDownloadItems = throttle(() => {
|
||||
const throttledClearDownloadedItems = throttle(() => {
|
||||
ipcRenderer.send(apiName.symphonyApi, {
|
||||
cmd: apiCmds.clearDownloadItems,
|
||||
});
|
||||
@ -526,23 +526,23 @@ export class SSFApi {
|
||||
* Open Downloaded item
|
||||
* @param id ID of the item
|
||||
*/
|
||||
public openDownloadItem(id: string): void {
|
||||
throttledOpenDownloadItem(id);
|
||||
public openDownloadedItem(id: string): void {
|
||||
throttledOpenDownloadedItem(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show downloaded item in finder / explorer
|
||||
* @param id ID of the item
|
||||
*/
|
||||
public showDownloadItem(id: string): void {
|
||||
throttledShowDownloadItem(id);
|
||||
public showDownloadedItem(id: string): void {
|
||||
throttledShowDownloadedItem(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears downloaded items
|
||||
*/
|
||||
public clearDownloadItems(): void {
|
||||
throttledClearDownloadItems();
|
||||
public clearDownloadedItems(): void {
|
||||
throttledClearDownloadedItems();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user