Skip to content

Commit

Permalink
Setting default refresh value for task view as none. (#88)
Browse files Browse the repository at this point in the history
As part of this we added a default parameter that can be passed for refresh widget to avoid every refresh widget getting affected.
  • Loading branch information
lokesh-lingarajan authored and kkonstantine committed Dec 13, 2022
1 parent 8756c80 commit 9a52b19
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions web-console/src/components/refresh-button/refresh-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,16 @@ const DELAYS: DelayLabel[] = [
export interface RefreshButtonProps {
onRefresh: (auto: boolean) => void;
localStorageKey?: LocalStorageKeys;
defaultDelay?: number;
}

export const RefreshButton = React.memo(function RefreshButton(props: RefreshButtonProps) {
const { onRefresh, localStorageKey } = props;
const { onRefresh, localStorageKey, defaultDelay = 30000 } = props;

return (
<TimedButton
className="refresh-button"
defaultDelay={30000}
defaultDelay={defaultDelay}
label="Auto refresh every"
delays={DELAYS}
icon={IconNames.REFRESH}
Expand Down
1 change: 1 addition & 0 deletions web-console/src/views/ingestion-view/ingestion-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1193,6 +1193,7 @@ ORDER BY
</ButtonGroup>
<RefreshButton
localStorageKey={LocalStorageKeys.TASKS_REFRESH_RATE}
defaultDelay={0}
onRefresh={auto => {
if (auto && hasPopoverOpen()) return;
this.taskQueryManager.rerunLastQuery(auto);
Expand Down

0 comments on commit 9a52b19

Please sign in to comment.