mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2026-02-12 05:51:45 +01:00
svelte state_referenced_locally warning fixes
- change to derived where possible - suppress warning elsewhere - discussion here: sveltejs/svelte/issues/17289
This commit is contained in:
@@ -37,7 +37,6 @@
|
||||
/* Const Init */
|
||||
const { query: initq } = init();
|
||||
const ccconfig = getContext("cc-config");
|
||||
const presetProject = filterPresets?.project ? filterPresets.project : ""
|
||||
|
||||
/* State Init */
|
||||
let filterComponent = $state(); // see why here: https://stackoverflow.com/questions/58287729/how-can-i-export-a-function-from-a-svelte-component-that-changes-a-value-in-the
|
||||
@@ -51,13 +50,16 @@
|
||||
let showCompare = $state(false);
|
||||
let isMetricsSelectionOpen = $state(false);
|
||||
let sorting = $state({ field: "startTime", type: "col", order: "DESC" });
|
||||
let selectedCluster = $state(filterPresets?.cluster ? filterPresets.cluster : null);
|
||||
let metrics = $state(filterPresets.cluster
|
||||
|
||||
/* Derived */
|
||||
const presetProject = $derived(filterPresets?.project ? filterPresets.project : "");
|
||||
let selectedCluster = $derived(filterPresets?.cluster ? filterPresets.cluster : null);
|
||||
let metrics = $derived(filterPresets.cluster
|
||||
? ccconfig[`metricConfig_jobListMetrics:${filterPresets.cluster}`] ||
|
||||
ccconfig.metricConfig_jobListMetrics
|
||||
: ccconfig.metricConfig_jobListMetrics
|
||||
);
|
||||
let showFootprint = $state(filterPresets.cluster
|
||||
let showFootprint = $derived(filterPresets.cluster
|
||||
? !!ccconfig[`jobList_showFootprint:${filterPresets.cluster}`]
|
||||
: !!ccconfig.jobList_showFootprint
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user