Skip to content

Commit 4a96d65

Browse files
committed
fix(processes): avoid saved-search chart request when chartId missing
1 parent b60ade1 commit 4a96d65

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

resources/js/processes-catalogue/components/BaseChart.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ export default {
172172
* Both packages go always together
173173
*/
174174
fetchChart() {
175-
if (!ProcessMaker.packages.includes("package-collections") && this.chartId === null && this.chartId === 0) {
175+
const hasCollections = ProcessMaker.packages.includes("package-collections");
176+
if (!hasCollections || !this.chartId) {
176177
this.getDefaultData();
177178
return;
178179
}
@@ -297,7 +298,7 @@ export default {
297298
const launchpadProperties = unparseProperties
298299
? JSON.parse(unparseProperties)
299300
: "";
300-
this.chartId = launchpadProperties.saved_chart_id;
301+
this.chartId = launchpadProperties?.saved_chart_id || 0;
301302
this.fetchChart();
302303
})
303304
.catch((error) => {

0 commit comments

Comments
 (0)