File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -990,10 +990,12 @@ export default {
990990 return ;
991991 }
992992 window .dispatchEvent (new CustomEvent (' set-custom-area-indicator-loading' , { detail: true }));
993-
993+ const options = {
994+ currentTimeIndex: this .currentTimeIndex ,
995+ };
994996 try {
995997 const custom = await fetchCustomAreaObjects (
996- {} ,
998+ options ,
997999 this .drawnArea .area ,
9981000 this .mergedConfigsData [0 ],
9991001 this .indicator ,
Original file line number Diff line number Diff line change @@ -390,7 +390,10 @@ export const fetchCustomAreaObjects = async (
390390 // TODO: Sending more requests overloads server, need to think how to handle this
391391 let requestTimes = indicator . time ;
392392 if ( indicator . time . length > 365 ) {
393- requestTimes = indicator . time . slice ( - 365 ) ;
393+ if ( options . currentTimeIndex ) {
394+ const startIndex = Math . max ( 0 , options . currentTimeIndex - 365 ) ;
395+ requestTimes = indicator . time . slice ( startIndex , options . currentTimeIndex ) ;
396+ }
394397 }
395398 requestTimes . forEach ( ( entry ) => {
396399 const requestUrl = `${ url } ?url=${ entry [ 1 ] } ` ;
You can’t perform that action at this time.
0 commit comments