Skip to content

Commit

Permalink
removed hard location.reload everywhere except IndexStatus.tsx , whil…
Browse files Browse the repository at this point in the history
…e clearing local cache.
  • Loading branch information
Deb-cybe committed Jan 28, 2024
1 parent b4ab2b5 commit 2363e5f
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion apps/web/src/components/Common/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const Layout: FC<LayoutProps> = ({ children }) => {
signOut();
disconnect?.();
if (reload) {
window.location.href='/';
window.location.href = window.location.href + '?nocache=' + (new Date()).getTime();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const LensSubscriptionsProvider: FC = () => {
// Using not null assertion because api returns null if revoked
if (!authorizationRecordRevoked) {
signOut();
window.location.href='/';
window.location.href = window.location.href + '?nocache=' + (new Date()).getTime();
}
}, [authorizationRecordRevokedData]);
// End: Authorization Record Revoked
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/Shared/IndexStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const IndexStatus: FC<IndexStatusProps> = ({
) {
setPollInterval(0);
if (reload) {
window.location.href='/';
window.location.href = window.location.href + '?nocache=' + (new Date()).getTime();
}
setTimeout(() => {
setHide(true);
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/Shared/Login/WalletSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const WalletSelector: FC<WalletSelectorProps> = ({
const refreshToken = auth.data?.authenticate.refreshToken;
signIn({ accessToken, refreshToken });
Leafwatch.track(AUTH.SIWL);
window.location.href='/';
window.location.href = window.location.href + '?nocache=' + (new Date()).getTime();
} catch {}
};

Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/Shared/Navbar/NavItems/Logout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const Logout: FC<LogoutProps> = ({ className = '', onClick }) => {
resetPreferences();
signOut();
disconnect?.();
window.location.href="/";
window.location.href = window.location.href + '?nocache=' + (new Date()).getTime();
} catch (error) {
onError(error);
} finally {
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/components/Shared/SwitchProfiles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ const SwitchProfiles: FC = () => {
const refreshToken = auth.data?.authenticate.refreshToken;
signOut();
signIn({ accessToken, refreshToken });
Leafwatch.track(PROFILE.SWITCH_PROFILE, { switch_profile_to: id });
window.location.href='/';
Leafwatch.track(PROFILE.SWITCH_PROFILE, { switch_profile_to: id });
window.location.href = window.location.href + '?nocache=' + (new Date()).getTime();
} catch (error) {
onError(error);
}
Expand Down

0 comments on commit 2363e5f

Please sign in to comment.