CSS editor fixes
This commit is contained in:
parent
ebff286c31
commit
5e8e9fa19f
|
@ -12,7 +12,7 @@ import { ipcRenderer } from 'electron';
|
|||
|
||||
const callbacks = new WeakMap();
|
||||
|
||||
export default new class ClientIPC {
|
||||
const ClientIPC = new class ClientIPC {
|
||||
|
||||
constructor() {
|
||||
this.on('ping', () => 'pong', true);
|
||||
|
@ -114,6 +114,8 @@ export default new class ClientIPC {
|
|||
|
||||
}
|
||||
|
||||
export default ClientIPC;
|
||||
|
||||
/**
|
||||
* An IPC event.
|
||||
*/
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
const { ipcRenderer } = window.require('electron');
|
||||
|
||||
export default class {
|
||||
|
||||
static on(channel, cb) {
|
||||
ipcRenderer.on(channel, (event, args) => cb(event, args));
|
||||
}
|
||||
|
||||
static async send(channel, message) {
|
||||
const __eid = Date.now().toString();
|
||||
ipcRenderer.send(
|
||||
channel.startsWith('bd-') ? channel: `bd-${channel}`,
|
||||
message === undefined ? { __eid } : Object.assign(message, { __eid })
|
||||
);
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
ipcRenderer.once(__eid, (event, arg) => {
|
||||
if (arg.err) return reject(arg);
|
||||
resolve(arg);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
static sendToDiscord(channel, message) {
|
||||
this.send('bd-sendToDiscord', { channel, message });
|
||||
}
|
||||
|
||||
}
|
|
@ -17,7 +17,7 @@ module.exports = {
|
|||
entry: './src/index.js',
|
||||
output: {
|
||||
path: path.resolve(__dirname, 'dist'),
|
||||
filename: 'csseditor.js'
|
||||
filename: 'csseditor-release.js'
|
||||
},
|
||||
module: {
|
||||
loaders: [vueLoader, scssLoader]
|
||||
|
|
|
@ -58,7 +58,8 @@ const index = function() {
|
|||
|
||||
const cssEditor = function() {
|
||||
return pump([
|
||||
gulp.src('./csseditor/dist/**/*'),
|
||||
gulp.src('./csseditor/dist/csseditor-release.js'),
|
||||
rename('csseditor.js'),
|
||||
copy('release/csseditor', { prefix: 2 })
|
||||
]);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue