Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions localtypings/pxteditor.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ declare namespace pxt.editor {
| "renderxml"
| "renderbyblockid"
| "setscale"
| "updatefilters"
| "startactivity"
| "saveproject"
| "compile"
Expand Down Expand Up @@ -1028,6 +1029,7 @@ declare namespace pxt.editor {
handleExtensionRequest(request: pxt.editor.ExtensionRequest): void;

fireResize(): void;
updateFilters(filters?: pxt.editor.ProjectFilters): void;
updateEditorLogo(left: number, rgba?: string): number;

loadBlocklyAsync(): Promise<void>;
Expand Down
9 changes: 9 additions & 0 deletions pxteditor/editorcontroller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ export function bindEditorMessages(getEditorAsync: () => Promise<IProjectView>)
return Promise.resolve()
.then(() => projectView.editor.setScale(zoommsg.scale));
}
case "updatefilters": return Promise.resolve()
.then(() => {
// Restored from LBOS-1046 (lost in the v12 upstream merge).
// p2-studio CodingCanvas sends { type: 'pxteditor', action: 'updatefilters',
// filters: {...} } when active bits change, so the toolbox can be restricted
// to blocks/namespaces appropriate for the connected codeBit / BLE bit.
const filters = (data as any).filters as pxt.editor.ProjectFilters;
projectView.updateFilters(filters);
});
case "stopsimulator": {
const stop = data as pxt.editor.EditorMessageStopRequest;
return Promise.resolve()
Expand Down
Loading