Fix turbo mode stored in project not appearing in GUI state
This commit is contained in:
1 parent
bbd9631a41
commit
7ea25cbbe8
3 files changed
+17
No files matched your search
@@ -188,6 +188,12 @@ class VirtualMachine extends EventEmitter {
|
||||
this.runtime.on(Runtime.COMPILE_ERROR, (target, error) => {
|
||||
this.emit(Runtime.COMPILE_ERROR, target, error);
|
||||
});
|
||||
this.runtime.on(Runtime.TURBO_MODE_OFF, () => {
|
||||
this.emit(Runtime.TURBO_MODE_OFF);
|
||||
});
|
||||
this.runtime.on(Runtime.TURBO_MODE_ON, () => {
|
||||
this.emit(Runtime.TURBO_MODE_ON);
|
||||
});
|
||||
|
||||
this.extensionManager = new ExtensionManager(this.runtime);
|
||||
|
||||
|
||||
BIN
Binary file not shown.
@@ -87,3 +87,14 @@ test('Storing settings emits project changed', t => {
|
||||
t.end();
|
||||
});
|
||||
});
|
||||
|
||||
test('Stored turbo mode emits event on VM', async t => {
|
||||
const vm = makeVM();
|
||||
const project = readFileToBuffer(path.resolve(__dirname, '../fixtures/tw-stored-settings/turbo-mode.sb3'));
|
||||
t.plan(1);
|
||||
vm.on('TURBO_MODE_ON', () => {
|
||||
t.pass('emitted TURBO_MODE_ON');
|
||||
});
|
||||
await vm.loadProject(project);
|
||||
t.end();
|
||||
});
|
||||
Reference in new issue
Block a user