diff --git a/src/components/DashKit/DashKit.tsx b/src/components/DashKit/DashKit.tsx index 4818018..28d7b3d 100644 --- a/src/components/DashKit/DashKit.tsx +++ b/src/components/DashKit/DashKit.tsx @@ -222,4 +222,8 @@ export class DashKit extends React.PureComponent { getItemsMeta() { return this.metaRef.current?.getItemsMeta(); } + + reloadItems(targetIds?: string[]) { + this.metaRef.current?.reloadItems(targetIds); + } } diff --git a/src/components/GridLayout/GridLayout.js b/src/components/GridLayout/GridLayout.js index 6c65d8f..58c0552 100644 --- a/src/components/GridLayout/GridLayout.js +++ b/src/components/GridLayout/GridLayout.js @@ -204,15 +204,20 @@ export default class GridLayout extends React.PureComponent { }); } - reloadItems() { + reloadItems(targetIds) { const { editMode, settings: {autoupdateInterval, silentLoading} = {}, reloadItems, } = this.context; + const {isPageHidden} = this.state; const autoupdateIntervalMs = Number(autoupdateInterval) * 1000; - if (autoupdateIntervalMs) { + + if (targetIds) { + const targetPluginRefs = this.pluginsRefs.filter((ref) => targetIds.includes(ref.id)); + reloadItems(targetPluginRefs, {silentLoading, noVeil: true, targetIds}); + } else if (autoupdateIntervalMs) { const timeSinceLastReload = new Date().getTime() - (this._lastReloadAt || 0); const reloadIntervalRemains = autoupdateIntervalMs - timeSinceLastReload;