Skip to content

Commit

Permalink
/claim heyxyz#4182
Browse files Browse the repository at this point in the history
  • Loading branch information
aadil-01 committed Jan 4, 2024
1 parent 390f616 commit 3294e93
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 6 deletions.
1 change: 1 addition & 0 deletions apps/web/package.json
Expand Up @@ -41,6 +41,7 @@
"axios": "^1.6.3",
"browser-image-compression": "^2.0.2",
"chart.js": "^4.4.1",
"clear-cache": "^1.1.0",
"dotenv": "^16.3.1",
"esbuild": "^0.19.11",
"framer-motion": "^10.17.2",
Expand Down
4 changes: 3 additions & 1 deletion apps/web/src/components/Common/Layout.tsx
Expand Up @@ -8,6 +8,7 @@ import PageMetatags from '@components/Shared/PageMetatags';
import { useCurrentProfileQuery } from '@hey/lens';
import getCurrentSession from '@lib/getCurrentSession';
import getToastOptions from '@lib/getToastOptions';
import clearCache from 'clear-cache';
import { useTheme } from 'next-themes';
import { Toaster } from 'react-hot-toast';
import { useNonceStore } from 'src/store/non-persisted/useNonceStore';
Expand Down Expand Up @@ -55,7 +56,8 @@ const Layout: FC<LayoutProps> = ({ children }) => {
signOut();
disconnect?.();
if (reload) {
location.reload();
//location.reload();
clearCache();
}
};

Expand Down
Expand Up @@ -10,6 +10,7 @@ import {
import { BrowserPush } from '@lib/browserPush';
import getCurrentSession from '@lib/getCurrentSession';
import getPushNotificationData from '@lib/getPushNotificationData';
import clearCache from 'clear-cache';
import { isSupported, share } from 'shared-zustand';
import { useNonceStore } from 'src/store/non-persisted/useNonceStore';
import { signOut } from 'src/store/persisted/useAuthStore';
Expand Down Expand Up @@ -84,7 +85,8 @@ const LensSubscriptionsProvider: FC = () => {
// Using not null assertion because api returns null if revoked
if (!authorizationRecordRevoked) {
signOut();
location.reload();
//location.reload();
clearCache();
}
}, [authorizationRecordRevokedData]);
// End: Authorization Record Revoked
Expand Down
4 changes: 3 additions & 1 deletion apps/web/src/components/Shared/IndexStatus.tsx
Expand Up @@ -8,6 +8,7 @@ import {
} from '@hey/lens';
import { Spinner } from '@hey/ui';
import cn from '@hey/ui/cn';
import clearCache from 'clear-cache';
import { useState } from 'react';

interface IndexStatusProps {
Expand All @@ -33,7 +34,8 @@ const IndexStatus: FC<IndexStatusProps> = ({
) {
setPollInterval(0);
if (reload) {
location.reload();
//location.reload();
clearCache();
}
setTimeout(() => {
setHide(true);
Expand Down
4 changes: 3 additions & 1 deletion apps/web/src/components/Shared/Login/WalletSelector.tsx
Expand Up @@ -26,6 +26,7 @@ import { Button, Card, Spinner } from '@hey/ui';
import cn from '@hey/ui/cn';
import errorToast from '@lib/errorToast';
import { Leafwatch } from '@lib/leafwatch';
import clearCache from 'clear-cache';
import { useState } from 'react';
import toast from 'react-hot-toast';
import { CHAIN_ID } from 'src/constants';
Expand Down Expand Up @@ -126,7 +127,8 @@ const WalletSelector: FC<WalletSelectorProps> = ({
const refreshToken = auth.data?.authenticate.refreshToken;
signIn({ accessToken, refreshToken });
Leafwatch.track(AUTH.SIWL);
location.reload();
clearCache();
//location.reload();
} catch {}
};

Expand Down
4 changes: 3 additions & 1 deletion apps/web/src/components/Shared/Navbar/NavItems/Logout.tsx
Expand Up @@ -7,6 +7,7 @@ import cn from '@hey/ui/cn';
import errorToast from '@lib/errorToast';
import getCurrentSession from '@lib/getCurrentSession';
import { Leafwatch } from '@lib/leafwatch';
import clearCache from 'clear-cache';
import { useState } from 'react';
import { usePreferencesStore } from 'src/store/non-persisted/usePreferencesStore';
import { signOut } from 'src/store/persisted/useAuthStore';
Expand Down Expand Up @@ -45,7 +46,8 @@ const Logout: FC<LogoutProps> = ({ className = '', onClick }) => {
resetPreferences();
signOut();
disconnect?.();
location.reload();
//location.reload();
clearCache();
} catch (error) {
onError(error);
} finally {
Expand Down
4 changes: 3 additions & 1 deletion apps/web/src/components/Shared/SwitchProfiles.tsx
Expand Up @@ -22,6 +22,7 @@ import { ErrorMessage, Image, Spinner } from '@hey/ui';
import cn from '@hey/ui/cn';
import errorToast from '@lib/errorToast';
import { Leafwatch } from '@lib/leafwatch';
import clearCache from 'clear-cache';
import Link from 'next/link';
import { useState } from 'react';
import toast from 'react-hot-toast';
Expand Down Expand Up @@ -97,7 +98,8 @@ const SwitchProfiles: FC = () => {
signOut();
signIn({ accessToken, refreshToken });
Leafwatch.track(PROFILE.SWITCH_PROFILE, { switch_profile_to: id });
location.reload();
//location.reload();
clearCache();
} catch (error) {
onError(error);
}
Expand Down

0 comments on commit 3294e93

Please sign in to comment.