Skip to content
This repository has been archived by the owner on Jan 31, 2023. It is now read-only.

Fixes New Version Available + Reduces Sentry transaction amount #173

Merged
merged 5 commits into from
Jan 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web/config/exchanges.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/config/zones.json

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ const handleReload = () => {
export default function App(): ReactElement {
const currentAppVersion = APP_VERSION;
const { data, isSuccess } = useGetAppVersion();
const isNewVersionAvailable =
data?.version && currentAppVersion && isProduction
? data.version !== currentAppVersion
: false;
const latestAppVersion = data?.version || '0';
const isNewVersionAvailable = isProduction && latestAppVersion > currentAppVersion;
console.log('New app version available:', latestAppVersion);

return (
<Suspense fallback={<div />}>
Expand Down
1 change: 1 addition & 0 deletions web/src/api/getAppVersion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ export const useGetAppVersion = () =>
useQuery<{ version: string }>([], async () => getVersion(), {
refetchInterval: REFETCH_INTERVAL_ONE_HOUR,
refetchOnWindowFocus: false,
cacheTime: 0,
});
2 changes: 1 addition & 1 deletion web/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ if (isProduction) {
),
}),
],
tracesSampleRate: 1, //This will send 100% of errors to Sentry
tracesSampleRate: 0.1, //This will send 10% of transactions to Sentry
});
}
/**
Expand Down