mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -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;
|
const id = items[items.length - 1].id;
|
||||||
if (window.ssf) {
|
if (window.ssf) {
|
||||||
window.ssf.openDownloadItem(id);
|
window.ssf.openDownloadedItem(id);
|
||||||
} else {
|
} else {
|
||||||
postMessage(apiCmds.openDownloadItem, id);
|
postMessage(apiCmds.openDownloadItem, id);
|
||||||
}
|
}
|
||||||
@ -878,7 +878,7 @@
|
|||||||
}
|
}
|
||||||
const id = items[items.length - 1].id;
|
const id = items[items.length - 1].id;
|
||||||
if (window.ssf) {
|
if (window.ssf) {
|
||||||
window.ssf.showDownloadItem(id);
|
window.ssf.showDownloadedItem(id);
|
||||||
} else {
|
} else {
|
||||||
postMessage(apiCmds.showDownloadItem, id);
|
postMessage(apiCmds.showDownloadItem, id);
|
||||||
}
|
}
|
||||||
@ -887,7 +887,7 @@
|
|||||||
document.getElementById('close-download-manager').addEventListener('click', () => {
|
document.getElementById('close-download-manager').addEventListener('click', () => {
|
||||||
items = [];
|
items = [];
|
||||||
if (window.ssf) {
|
if (window.ssf) {
|
||||||
window.ssf.clearDownloadItems();
|
window.ssf.clearDownloadedItems();
|
||||||
} else {
|
} else {
|
||||||
postMessage(apiCmds.clearDownloadItems);
|
postMessage(apiCmds.clearDownloadItems);
|
||||||
}
|
}
|
||||||
|
@ -111,16 +111,16 @@ export class AppBridge {
|
|||||||
break;
|
break;
|
||||||
case apiCmds.openDownloadItem:
|
case apiCmds.openDownloadItem:
|
||||||
if (typeof data === 'string') {
|
if (typeof data === 'string') {
|
||||||
ssf.openDownloadItem(data as string);
|
ssf.openDownloadedItem(data as string);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case apiCmds.showDownloadItem:
|
case apiCmds.showDownloadItem:
|
||||||
if (typeof data === 'string') {
|
if (typeof data === 'string') {
|
||||||
ssf.showDownloadItem(data as string);
|
ssf.showDownloadedItem(data as string);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case apiCmds.clearDownloadItems:
|
case apiCmds.clearDownloadItems:
|
||||||
ssf.clearDownloadItems();
|
ssf.clearDownloadedItems();
|
||||||
break;
|
break;
|
||||||
case apiCmds.setLocale:
|
case apiCmds.setLocale:
|
||||||
if (typeof data === 'string') {
|
if (typeof data === 'string') {
|
||||||
|
@ -59,6 +59,9 @@ if (ssfWindow.ssf) {
|
|||||||
getVersionInfo: ssfWindow.ssf.getVersionInfo,
|
getVersionInfo: ssfWindow.ssf.getVersionInfo,
|
||||||
registerActivityDetection: ssfWindow.ssf.registerActivityDetection,
|
registerActivityDetection: ssfWindow.ssf.registerActivityDetection,
|
||||||
registerDownloadHandler: ssfWindow.ssf.registerDownloadHandler,
|
registerDownloadHandler: ssfWindow.ssf.registerDownloadHandler,
|
||||||
|
openDownloadedItem: ssfWindow.ssf.openDownloadedItem,
|
||||||
|
showDownloadedItem: ssfWindow.ssf.showDownloadedItem,
|
||||||
|
clearDownloadedItems: ssfWindow.ssf.clearDownloadedItems,
|
||||||
registerBoundsChange: ssfWindow.ssf.registerBoundsChange,
|
registerBoundsChange: ssfWindow.ssf.registerBoundsChange,
|
||||||
registerLogger: ssfWindow.ssf.registerLogger,
|
registerLogger: ssfWindow.ssf.registerLogger,
|
||||||
registerProtocolHandler: ssfWindow.ssf.registerProtocolHandler,
|
registerProtocolHandler: ssfWindow.ssf.registerProtocolHandler,
|
||||||
|
@ -102,21 +102,21 @@ const throttledSetCloudConfig = throttle((data) => {
|
|||||||
});
|
});
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
||||||
const throttledOpenDownloadItem = throttle((id: string) => {
|
const throttledOpenDownloadedItem = throttle((id: string) => {
|
||||||
ipcRenderer.send(apiName.symphonyApi, {
|
ipcRenderer.send(apiName.symphonyApi, {
|
||||||
cmd: apiCmds.openDownloadItem,
|
cmd: apiCmds.openDownloadItem,
|
||||||
id,
|
id,
|
||||||
});
|
});
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
||||||
const throttledShowDownloadItem = throttle((id: string) => {
|
const throttledShowDownloadedItem = throttle((id: string) => {
|
||||||
ipcRenderer.send(apiName.symphonyApi, {
|
ipcRenderer.send(apiName.symphonyApi, {
|
||||||
cmd: apiCmds.showDownloadItem,
|
cmd: apiCmds.showDownloadItem,
|
||||||
id,
|
id,
|
||||||
});
|
});
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
||||||
const throttledClearDownloadItems = throttle(() => {
|
const throttledClearDownloadedItems = throttle(() => {
|
||||||
ipcRenderer.send(apiName.symphonyApi, {
|
ipcRenderer.send(apiName.symphonyApi, {
|
||||||
cmd: apiCmds.clearDownloadItems,
|
cmd: apiCmds.clearDownloadItems,
|
||||||
});
|
});
|
||||||
@ -526,23 +526,23 @@ export class SSFApi {
|
|||||||
* Open Downloaded item
|
* Open Downloaded item
|
||||||
* @param id ID of the item
|
* @param id ID of the item
|
||||||
*/
|
*/
|
||||||
public openDownloadItem(id: string): void {
|
public openDownloadedItem(id: string): void {
|
||||||
throttledOpenDownloadItem(id);
|
throttledOpenDownloadedItem(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show downloaded item in finder / explorer
|
* Show downloaded item in finder / explorer
|
||||||
* @param id ID of the item
|
* @param id ID of the item
|
||||||
*/
|
*/
|
||||||
public showDownloadItem(id: string): void {
|
public showDownloadedItem(id: string): void {
|
||||||
throttledShowDownloadItem(id);
|
throttledShowDownloadedItem(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clears downloaded items
|
* Clears downloaded items
|
||||||
*/
|
*/
|
||||||
public clearDownloadItems(): void {
|
public clearDownloadedItems(): void {
|
||||||
throttledClearDownloadItems();
|
throttledClearDownloadedItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user