@@ -36,7 +36,7 @@ import { uploadingFileDataToAsset } from "~/builder/shared/assets/asset-utils";
3636import  {  fetch  }  from  "~/shared/fetch.client" ; 
3737import  {  $selectedPage ,  getInstanceKey  }  from  "../awareness" ; 
3838import  {  computeExpression  }  from  "../data-variables" ; 
39- import  {  $currentSystem ,   $currentSystemVariableId  }  from  "../system" ; 
39+ import  {  $currentSystem  }  from  "../system" ; 
4040
4141export  const  assetBaseUrl  =  "/cgi/asset/" ; 
4242
@@ -168,14 +168,10 @@ const $unscopedVariableValues = computed(
168168 * circular updates 
169169 */ 
170170const  $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 )  =>  { 
178173    const  values  =  new  Map < string ,  unknown > ( ) ; 
174+     values . set ( SYSTEM_VARIABLE_ID ,  system ) ; 
179175    for  ( const  [ dataSourceId ,  dataSource ]  of  dataSources )  { 
180176      if  ( dataSource . type  ===  "variable" )  { 
181177        values . set ( 
@@ -185,7 +181,7 @@ const $loaderVariableValues = computed(
185181      } 
186182      if  ( dataSource . type  ===  "parameter" )  { 
187183        let  value  =  dataSourceVariables . get ( dataSourceId ) ; 
188-         if  ( dataSource . id  ===  systemVariableId )  { 
184+         if  ( dataSource . id  ===  selectedPage ?. systemDataSourceId )  { 
189185          value  =  system ; 
190186        } 
191187        values . set ( dataSourceId ,  value ) ; 
0 commit comments