Skip to content

Commit

Permalink
Fix app version
Browse files Browse the repository at this point in the history
  • Loading branch information
KuznetsovNikita committed Dec 30, 2023
1 parent 5309253 commit cdaaed3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apps/desktop/src/app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export const Loader: FC = () => {
const navigate = useNavigate();
useAppHeight();

const { data: tracker } = useAnalytics(account, activeWallet);
const { data: tracker } = useAnalytics(sdk.version, account, activeWallet);

useEffect(() => {
if (
Expand Down
1 change: 0 additions & 1 deletion apps/desktop/src/backgroud.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
interface BackgroundApi {
platform: () => string;
arch: () => string;
version: () => string;
node: () => string;
chrome: () => string;
electron: () => string;
Expand Down
8 changes: 6 additions & 2 deletions apps/desktop/src/libs/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ export const useAppWidth = () => {

declare const REACT_APP_MEASUREMENT_ID: string;

export const useAnalytics = (account?: AccountState, wallet?: WalletState | null) => {
export const useAnalytics = (
version: string,
account?: AccountState,
wallet?: WalletState | null
) => {
return useQuery<Analytics>(
[QueryKey.analytics],
async () => {
Expand All @@ -54,7 +58,7 @@ export const useAnalytics = (account?: AccountState, wallet?: WalletState | null
toWalletType(wallet),
account,
wallet,
window.backgroundApi.version(),
version,
`${window.backgroundApi.platform()}-${window.backgroundApi.arch()}`
);

Expand Down
3 changes: 1 addition & 2 deletions apps/desktop/src/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
// https://www.electronjs.org/docs/latest/tutorial/process-model#preload-scripts

import { SendTransactionAppRequest } from '@tonkeeper/uikit/dist/components/connect/connectHook';
import { app, contextBridge, ipcRenderer } from 'electron';
import { contextBridge, ipcRenderer } from 'electron';
import { Message } from './libs/message';

contextBridge.exposeInMainWorld('backgroundApi', {
platform: () => process.platform,
arch: () => process.arch,
version: () => app.getVersion(),
node: () => process.versions.node,
chrome: () => process.versions.chrome,
electron: () => process.versions.electron,
Expand Down

0 comments on commit cdaaed3

Please sign in to comment.