Skip to content

Commit

Permalink
Disable dynamic updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dsblank committed May 4, 2023
1 parent 3532f1d commit 2ffaa86
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion backend/kangas/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
# All rights reserved #
######################################################

version_info = (2, 3, 6)
version_info = (2, 3, 7)
__version__ = ".".join(map(str, version_info))
7 changes: 5 additions & 2 deletions frontend/app/Polling.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

import fetchTimestamp from "@kangas/lib/fetchTimestamp";
import useQueryParams from "@kangas/lib/hooks/useQueryParams";
import { useCallback, useEffect, useRef } from "react";
import { useCallback, useEffect, useRef, useContext } from "react";
import { ConfigContext } from "@kangas/app/contexts/ConfigContext";

const Polling = ({ children }) => {
const { config } = useContext(ConfigContext);
const { params, updateParams } = useQueryParams();
const interval = useRef();

Expand All @@ -19,7 +21,8 @@ const Polling = ({ children }) => {
}, [params?.datagrid, params?.timestamp, updateParams]);

useEffect(() => {
// First time without a timestamp: cause timestamp to be added ASAP
// If disabled, don't start
if (!config.dynamic) return;

if (!!interval.current) clearInterval(interval.current);

Expand Down
3 changes: 2 additions & 1 deletion frontend/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ const localConfig = {
hideSelector: env.KANGAS_HIDE_SELECTOR === '1',
cache: true,
prefetch: false,
debug: false
debug: false,
dynamic: false,
};

export default localConfig;

0 comments on commit 2ffaa86

Please sign in to comment.