Skip to content

Commit a7352ef

Browse files
authored
Merge branch 'develop' into feat/ddw-1163-better-cpu-formatting-in-analytics
2 parents 0952f3c + ebb5b80 commit a7352ef

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
### Features
66

77
- Implemented CPU name grouping mechanism for analytics ([PR 3089](https://github.com/input-output-hk/daedalus/pull/3089))
8+
- Implemented rounding RAM size in analytics ([PR 3088](https://github.com/input-output-hk/daedalus/pull/3088))
89

910
### Chores
1011

12+
- Updated new Catalyst API URL ([PR 3087](https://github.com/input-output-hk/daedalus/pull/3087))
1113
- Fixed Storybook state for General stories ([PR 3064](https://github.com/input-output-hk/daedalus/pull/3064))
1214

1315
## 5.1.1

source/renderer/app/analytics/MatomoClient.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ export class MatomoClient implements AnalyticsClient {
3535
[CPU_DIMENSION_KEY]: getShortCpuDescription(
3636
this.environment.cpu[0]?.model
3737
),
38-
[RAM_DIMENSION_KEY]: formattedBytesToSize(this.environment.ram),
38+
[RAM_DIMENSION_KEY]: formattedBytesToSize(this.environment.ram, 0),
39+
[OS_DIMENSION_KEY]: this.environment.os,
3940
[VERSION_DIMENSION_KEY]: this.environment.version,
4041
});
4142
};

source/renderer/app/config/urlsConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const DEVELOPMENT_NEWS_HASH_URL = 'newsfeed.daedaluswallet.io';
1111
export const MAINNET_NEWS_HASH_URL = 'newsfeed.daedaluswallet.io';
1212
export const TESTNET_NEWS_HASH_URL = 'newsfeed.daedaluswallet.io';
1313
export const STAGING_NEWS_HASH_URL = 'newsfeed.daedaluswallet.io';
14-
export const MAINNET_SERVICING_STATION_URL = 'servicing-station.vit.iohk.io';
14+
export const MAINNET_SERVICING_STATION_URL = 'servicing-station.gov.iog.io';
1515
export const ALLOWED_EXTERNAL_HOSTNAMES = [
1616
MAINNET_EXPLORER_URL,
1717
STAGING_EXPLORER_URL,

source/renderer/app/utils/formatters.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,10 @@ export const formattedLovelaceToAmount = (lovelace: number): number =>
185185
formattedAmountToBigNumber(String(lovelace))
186186
.dividedBy(LOVELACES_PER_ADA)
187187
.toNumber();
188-
export const formattedBytesToSize = (bytes: number): string => {
188+
export const formattedBytesToSize = (
189+
bytes: number,
190+
decimalPlaces = 1
191+
): string => {
189192
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
190193
if (bytes === 0) return 'n/a';
191194
const i = parseInt(
@@ -194,7 +197,7 @@ export const formattedBytesToSize = (bytes: number): string => {
194197
10
195198
);
196199
if (i === 0) return `${bytes} ${sizes[i]})`;
197-
return `${formattedNumber(bytes / 1024 ** i, 1)} ${sizes[i]}`;
200+
return `${formattedNumber(bytes / 1024 ** i, decimalPlaces)} ${sizes[i]}`;
198201
};
199202
export type FormattedDownloadData = {
200203
timeLeft: string;

0 commit comments

Comments
 (0)