diff --git a/client/src/modules/csseditor.js b/client/src/modules/csseditor.js index 75144ca6..f462a945 100644 --- a/client/src/modules/csseditor.js +++ b/client/src/modules/csseditor.js @@ -47,6 +47,12 @@ export default class { if (sendSource) this.sendToEditor('set-scss', { scss }); + if (!scss) { + this._scss = this.css = ''; + this.sendToEditor('scss-editor', null); + return Promise.resolve(); + } + return new Promise((resolve, reject) => { this.compile(scss).then(css => { this.css = css; diff --git a/core/src/main.js b/core/src/main.js index 987a3924..5196ea8a 100644 --- a/core/src/main.js +++ b/core/src/main.js @@ -73,8 +73,8 @@ class Comms { }); BDIpc.on('bd-compileSass', o => { - if (!o.args.data && !o.args.path) return; - if (o.args.path && o.args.data) { + if (typeof o.args.path !== 'string' && typeof o.args.data !== 'string') return; + if (typeof o.args.path === 'string' && typeof o.args.data === 'string') { o.args.data = `${o.args.data} @import '${o.args.path}';`; o.args.path = undefined; }