From 8cd47376175f9b0c419c4041faf845cd7bd10240 Mon Sep 17 00:00:00 2001 From: Rohan-cp Date: Wed, 15 May 2024 17:24:17 -0400 Subject: [PATCH] fixed ts errors --- apps/mobile/package.json | 1 + .../utils/useIntervalEffectOnAppForeground.ts | 4 ++-- yarn.lock | 17 +++++++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/apps/mobile/package.json b/apps/mobile/package.json index e422d86c6b..525733d9ed 100644 --- a/apps/mobile/package.json +++ b/apps/mobile/package.json @@ -19,6 +19,7 @@ "@react-navigation/native-stack": "^6.9.10", "@sentry/react-native": "~5.20.0", "@shopify/flash-list": "1.6.3", + "@types/node": "20.11.16", "@walletconnect/modal-react-native": "^1.0.0-rc.10", "clsx": "^1.2.1", "date-fns": "^2.29.3", diff --git a/apps/mobile/src/utils/useIntervalEffectOnAppForeground.ts b/apps/mobile/src/utils/useIntervalEffectOnAppForeground.ts index 0fe97d2084..67035297ae 100644 --- a/apps/mobile/src/utils/useIntervalEffectOnAppForeground.ts +++ b/apps/mobile/src/utils/useIntervalEffectOnAppForeground.ts @@ -6,14 +6,14 @@ export function useIntervalEffectOnAppForeground(callback: () => void) { let interval: number; // Set up the interval when the component mounts - interval = setInterval(callback, 10000); + interval = setInterval(callback, 10000) as unknown as number; const handleAppStateChange = (nextAppState: AppStateStatus) => { if (nextAppState === 'active') { // When the app comes into the foreground, trigger the callback // and kick off the interval callback(); - interval = setInterval(callback, 10000); + interval = setInterval(callback, 10000) as unknown as number; } else if (nextAppState === 'background' || nextAppState === 'inactive') { // When the app goes to the background, clear the interval if (interval) { diff --git a/yarn.lock b/yarn.lock index 689e2d1764..ba25dbf9c8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10611,6 +10611,15 @@ __metadata: languageName: node linkType: hard +"@types/node@npm:20.11.16": + version: 20.11.16 + resolution: "@types/node@npm:20.11.16" + dependencies: + undici-types: ~5.26.4 + checksum: 51f0831c1219bf4698e7430aeb9892237bd851deeb25ce23c5bb0ceefcc77c3b114e48f4e98d9fc26def5a87ba9d8079f0281dd37bee691140a93f133812c152 + languageName: node + linkType: hard + "@types/node@npm:^12.12.54, @types/node@npm:^12.12.6": version: 12.20.55 resolution: "@types/node@npm:12.20.55" @@ -26248,6 +26257,7 @@ __metadata: "@shopify/flash-list": 1.6.3 "@types/lodash.merge": ^4.6.7 "@types/markdown-it": ^12.2.3 + "@types/node": 20.11.16 "@walletconnect/modal-react-native": ^1.0.0-rc.10 babel-plugin-relay: ^14.1.0 babel-plugin-tsconfig-paths-module-resolver: ^1.0.4 @@ -33359,6 +33369,13 @@ __metadata: languageName: node linkType: hard +"undici-types@npm:~5.26.4": + version: 5.26.5 + resolution: "undici-types@npm:5.26.5" + checksum: 3192ef6f3fd5df652f2dc1cd782b49d6ff14dc98e5dced492aa8a8c65425227da5da6aafe22523c67f035a272c599bb89cfe803c1db6311e44bed3042fc25487 + languageName: node + linkType: hard + "unenv@npm:^1.9.0": version: 1.9.0 resolution: "unenv@npm:1.9.0"