Skip to content

Commit 6b44519

Browse files
committed
Remove completely hidden frames.
1 parent efd46f5 commit 6b44519

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/datasource.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,7 @@ export class DataSource extends DataSourceApi<MyQuery, MyDataSourceOptions> {
2626

2727
const promises = options.targets.map(
2828
({ spaceId, roomId, contextId, nodes, groupBy, method, refId, dimensions, filterBy, filterValue, hide }) => {
29-
if (hide) {
30-
const frame = new MutableDataFrame({
31-
refId: refId,
32-
});
33-
return Promise.resolve(frame);
34-
}
29+
if (hide) return null;
3530

3631
if (!spaceId || !roomId || !contextId) {
3732
const frame = new MutableDataFrame({
@@ -85,7 +80,7 @@ export class DataSource extends DataSourceApi<MyQuery, MyDataSourceOptions> {
8580
}
8681
);
8782

88-
return Promise.all(promises).then((data) => ({ data }));
83+
return Promise.all(promises.filter(Boolean)).then((data) => ({ data }));
8984
}
9085

9186
async testDatasource() {

0 commit comments

Comments
 (0)