Refactoring
This commit is contained in:
13
src/utils.js
Normal file
13
src/utils.js
Normal file
@@ -0,0 +1,13 @@
|
||||
const ipcRenderer = (!process.versions.hasOwnProperty('electron') && window && window.require) ?
|
||||
window.require('electron').ipcRenderer :
|
||||
null;
|
||||
|
||||
export const extractFileNameFromURL = url => {
|
||||
const parts = url.split('/');
|
||||
return parts[parts.length - 1];
|
||||
};
|
||||
|
||||
export const getIPCRenderer = () => {
|
||||
return ipcRenderer;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user