mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) Fixing bug with deleting charts
Summary: Fix for a bug. When a chart had a "Group Data" checked, deleting it produced a JS error. Test Plan: browser test Reviewers: cyprien Reviewed By: cyprien Differential Revision: https://phab.getgrist.com/D3200
This commit is contained in:
parent
24c57e05d7
commit
52d3f63203
@ -403,11 +403,12 @@ export class ChartConfig extends GrainJSDisposable {
|
||||
)
|
||||
);
|
||||
|
||||
// The column id of the grouping column, or -1 if multiseries is disabled.
|
||||
// The column id of the grouping column, or -1 if multiseries is disabled or there are no viewFields,
|
||||
// for example during section removal.
|
||||
private _groupDataColId: Computed<number> = Computed.create(this, (use) => {
|
||||
const multiseries = use(this._optionsObj.prop('multiseries'));
|
||||
const viewFields = use(use(this._section.viewFields).getObservable());
|
||||
if (!multiseries) { return -1; }
|
||||
if (!multiseries || viewFields.length === 0) { return -1; }
|
||||
return use(viewFields[0].column).getRowId();
|
||||
})
|
||||
.onWrite((colId) => this._setGroupDataColumn(colId));
|
||||
|
Loading…
Reference in New Issue
Block a user