Skip to content

Commit

Permalink
Merge 4bcc4a1 into 1a18ff9
Browse files Browse the repository at this point in the history
  • Loading branch information
swain committed Jan 23, 2024
2 parents 1a18ff9 + 4bcc4a1 commit 7a47c28
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"@types/d3-scale": "^3.3.0",
"@types/jest": "^29.4.0",
"@types/lodash": "^4.14.191",
"@types/ms": "^0.7.34",
"@types/react": "^18.0.27",
"@types/react-native": "^0.71.0",
"axios": "^1.3.2",
Expand Down Expand Up @@ -156,6 +157,7 @@
"events": "^3.3.0",
"intl-pluralrules": "^1.3.1",
"lodash": "^4.17.21",
"ms": "^2.1.3",
"react-native-paper": "^5.12.1",
"react-native-vector-icons": "^9.2.0",
"react-navigation-header-buttons": "^9.0.1",
Expand Down
5 changes: 5 additions & 0 deletions src/hooks/useAppConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { SvgProps } from 'react-native-svg';
import { TextStyle, ViewStyle } from 'react-native';
import { useRestQuery } from './rest-api';
import { appConfigNotifier } from '../common/AppConfigNotifier';
import ms from 'ms';

export interface AppTile {
id: string;
Expand Down Expand Up @@ -123,6 +124,10 @@ export const useAppConfig = () => {
const query = useRestQuery(
'GET /v1/life-research/projects/:projectId/app-config',
{ projectId: activeProject.id },
{
// Longer stale time to avoid refetching every time someone changes pages.
staleTime: ms('10m'),
},
);

useEffect(() => {
Expand Down
7 changes: 6 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2947,6 +2947,11 @@
resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.31.tgz#31b7ca6407128a3d2bbc27fe2d21b345397f6197"
integrity sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==

"@types/ms@^0.7.34":
version "0.7.34"
resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.34.tgz#10964ba0dee6ac4cd462e2795b6bebd407303433"
integrity sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==

"@types/node@*":
version "18.11.18"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.18.tgz#8dfb97f0da23c2293e554c5a50d61ef134d7697f"
Expand Down Expand Up @@ -8394,7 +8399,7 @@ ms@2.1.2:
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==

ms@2.1.3, ms@^2.0.0, ms@^2.1.2:
ms@2.1.3, ms@^2.0.0, ms@^2.1.2, ms@^2.1.3:
version "2.1.3"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
Expand Down

0 comments on commit 7a47c28

Please sign in to comment.