Skip to content

Commit

Permalink
[issue-1104] Update web-runner (v1.1.19) - Update load data timing
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenduythuc committed Oct 27, 2023
1 parent 11e9dd0 commit 1801b71
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 17 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## 1.1.5 (228)
- Setup CI/CD - Update script for release - fix whatsNewDirectory is not created (#1056)
- Fix bug can not Send Sub0 NFT (#1088)
- Swipe to delete/copy account (#1066)
- Update web-runner (v1.1.19) (#1104)
- Setup CI/CD - Update script for release (#1056)
- Setup CI/CD (#1056)

## 1.1.4 (227)
Expand Down
6 changes: 5 additions & 1 deletion src/AppNew.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { SafeAreaProvider } from 'react-native-safe-area-context';
import { LockTimeout } from 'stores/types';
import { keyringLock } from './messaging';
import { updateAutoLockTime } from 'stores/MobileSettings';
import { useGetTokenConfigQuery } from 'stores/API';
import { useGetDAPPCategoriesQuery, useGetDAPPsQuery, useGetTokenConfigQuery } from 'stores/API';

const layerScreenStyle: StyleProp<any> = {
top: 0,
Expand Down Expand Up @@ -129,6 +129,8 @@ export const AppNew = () => {
const isI18nReady = useSetupI18n().isI18nReady;
useStoreBackgroundService();
const { refetch } = useGetTokenConfigQuery(undefined, { pollingInterval: 300000 });
const { refetch: refetchDAPPs } = useGetDAPPsQuery(undefined, { pollingInterval: 300000 });
const { refetch: refetchDAPPCategories } = useGetDAPPCategoriesQuery(undefined, { pollingInterval: 300000 });

// Enable lock screen on the start app
useEffect(() => {
Expand Down Expand Up @@ -166,6 +168,8 @@ export const AppNew = () => {
}, 100);

refetch();
refetchDAPPs();
refetchDAPPCategories();
// if (buildNumber === 1) {
// Set default value on the first time install
// const buildNumberInt = parseInt(getBuildNumber(), 10);
Expand Down
9 changes: 2 additions & 7 deletions src/screens/Home/Browser/BrowserHome.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useCallback, useEffect, useMemo } from 'react';
import React, { useCallback, useMemo } from 'react';
import { FlatList, ListRenderItem, ScrollView, View } from 'react-native';
import { CaretRight } from 'phosphor-react-native';
import createStylesheet from './styles/BrowserHome';
Expand Down Expand Up @@ -97,16 +97,11 @@ const ItemSeparator = () => {
const BrowserHome = () => {
const stylesheet = createStylesheet();
const theme = useSubWalletTheme().swThemes;
const { data: dApps, isLoading, refetch } = useGetDAPPsQuery(undefined);
const { data: dApps, isLoading } = useGetDAPPsQuery(undefined);
const navigation = useNavigation<RootNavigationProps>();
const historyItems = useSelector((state: RootState) => state.browser.history);
const bookmarkItems = useSelector((state: RootState) => state.browser.bookmarks);

useEffect(() => {
refetch();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

const recommendedList = useMemo((): RecommendedListType[] | [] => {
if (!dApps) {
return [];
Expand Down
9 changes: 2 additions & 7 deletions src/screens/Home/Browser/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react';
import React, { useState } from 'react';
import { ScreenContainer } from 'components/ScreenContainer';
import BrowserHome from './BrowserHome';
import BrowserHeader from './Shared/BrowserHeader';
Expand Down Expand Up @@ -69,7 +69,7 @@ const tabbarIcon = (focused: boolean, item: RoutesType, theme: ThemeTypes) => {
export const BrowserScreen = ({ navigation }: NativeStackScreenProps<{}>) => {
const theme = useSubWalletTheme().swThemes;
const stylesheet = createStylesheet(theme);
const { data: categories, refetch } = useGetDAPPCategoriesQuery(undefined);
const { data: categories } = useGetDAPPCategoriesQuery(undefined);
const [searchString] = useState<string>('');
const categoryTabRoutes = categories ? categories.map(item => ({ key: item.slug, title: item.name })) : [];
const allTabRoutes = [{ key: 'all', title: i18n.common.all }, ...categoryTabRoutes];
Expand All @@ -86,11 +86,6 @@ export const BrowserScreen = ({ navigation }: NativeStackScreenProps<{}>) => {
};
};

useEffect(() => {
refetch();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

const screenListener = {
focus: () => {
Animated.timing(av, {
Expand Down

0 comments on commit 1801b71

Please sign in to comment.