blob: 29b88836890c82bca6cb5646458114a300b3d72d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
const ipcRenderer = require("electron").ipcRenderer;
// show a toast message if no Internet connection has been detected.
if (! navigator.onLine) {
ipcRenderer.send("no-internet");
}
// invokes `requests.get()` from `src/modules/requests.js` through the
// main process, and returns the output
let request = async (...args) => {
return await ipcRenderer.invoke("request", ...args);
}
request.delete_cache = () => {
ipcRenderer.send("delete-request-cache");
}
module.exports = request;
|