Fix CSS editor not updating when empty
This commit is contained in:
parent
fdb6ddd540
commit
c9a20b7fcf
|
@ -47,6 +47,12 @@ export default class {
|
||||||
if (sendSource)
|
if (sendSource)
|
||||||
this.sendToEditor('set-scss', { scss });
|
this.sendToEditor('set-scss', { scss });
|
||||||
|
|
||||||
|
if (!scss) {
|
||||||
|
this._scss = this.css = '';
|
||||||
|
this.sendToEditor('scss-editor', null);
|
||||||
|
return Promise.resolve();
|
||||||
|
}
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.compile(scss).then(css => {
|
this.compile(scss).then(css => {
|
||||||
this.css = css;
|
this.css = css;
|
||||||
|
|
|
@ -73,8 +73,8 @@ class Comms {
|
||||||
});
|
});
|
||||||
|
|
||||||
BDIpc.on('bd-compileSass', o => {
|
BDIpc.on('bd-compileSass', o => {
|
||||||
if (!o.args.data && !o.args.path) return;
|
if (typeof o.args.path !== 'string' && typeof o.args.data !== 'string') return;
|
||||||
if (o.args.path && o.args.data) {
|
if (typeof o.args.path === 'string' && typeof o.args.data === 'string') {
|
||||||
o.args.data = `${o.args.data} @import '${o.args.path}';`;
|
o.args.data = `${o.args.data} @import '${o.args.path}';`;
|
||||||
o.args.path = undefined;
|
o.args.path = undefined;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue