@@ -36,7 +36,7 @@ import { uploadingFileDataToAsset } from "~/builder/shared/assets/asset-utils";
36
36
import { fetch } from "~/shared/fetch.client" ;
37
37
import { $selectedPage , getInstanceKey } from "../awareness" ;
38
38
import { computeExpression } from "../data-variables" ;
39
- import { $currentSystem , $currentSystemVariableId } from "../system" ;
39
+ import { $currentSystem } from "../system" ;
40
40
41
41
export const assetBaseUrl = "/cgi/asset/" ;
42
42
@@ -168,14 +168,10 @@ const $unscopedVariableValues = computed(
168
168
* circular updates
169
169
*/
170
170
const $loaderVariableValues = computed (
171
- [
172
- $dataSources ,
173
- $dataSourceVariables ,
174
- $currentSystemVariableId ,
175
- $currentSystem ,
176
- ] ,
177
- ( dataSources , dataSourceVariables , systemVariableId , system ) => {
171
+ [ $dataSources , $dataSourceVariables , $selectedPage , $currentSystem ] ,
172
+ ( dataSources , dataSourceVariables , selectedPage , system ) => {
178
173
const values = new Map < string , unknown > ( ) ;
174
+ values . set ( SYSTEM_VARIABLE_ID , system ) ;
179
175
for ( const [ dataSourceId , dataSource ] of dataSources ) {
180
176
if ( dataSource . type === "variable" ) {
181
177
values . set (
@@ -185,7 +181,7 @@ const $loaderVariableValues = computed(
185
181
}
186
182
if ( dataSource . type === "parameter" ) {
187
183
let value = dataSourceVariables . get ( dataSourceId ) ;
188
- if ( dataSource . id === systemVariableId ) {
184
+ if ( dataSource . id === selectedPage ?. systemDataSourceId ) {
189
185
value = system ;
190
186
}
191
187
values . set ( dataSourceId , value ) ;
0 commit comments