Skip to content

Commit

Permalink
fix shema
Browse files Browse the repository at this point in the history
  • Loading branch information
tombertrand committed Jan 11, 2024
1 parent 9a4b012 commit 853a161
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 21 deletions.
4 changes: 2 additions & 2 deletions server/client/mongo/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ async function createIndexes() {
if (!indexExists3) {
database
.collection(TOTAL_CONFIRMATIONS_COLLECTION)
.createIndex({ createdAt: 1 }, { expireAfterSeconds: EXPIRE_14D, ...extraOptions });
.createIndex({ createdAt: 1 }, { expireAfterSeconds: EXPIRE_1M, ...extraOptions });
console.log("Index TOTAL_CONFIRMATIONS_COLLECTION createdAt created successfully");
}

const indexExists4 = await database.collection(TOTAL_VOLUME_COLLECTION).indexExists("createdAt");
if (!indexExists4) {
database
.collection(TOTAL_VOLUME_COLLECTION)
.createIndex({ createdAt: 1 }, { expireAfterSeconds: EXPIRE_14D, ...extraOptions });
.createIndex({ createdAt: 1 }, { expireAfterSeconds: EXPIRE_1M, ...extraOptions });
console.log("Index TOTAL_VOLUME_COLLECTION createdAt created successfully");
}

Expand Down
35 changes: 16 additions & 19 deletions src/pages/Home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ const HomePage = () => {

let totalConfirmations48hAgo = 0;
let confirmationChange24h = 0;

if (marketStatistics[TOTAL_CONFIRMATIONS_24H] && marketStatistics[TOTAL_CONFIRMATIONS_48H]) {
totalConfirmations48hAgo = new BigNumber(marketStatistics[TOTAL_CONFIRMATIONS_48H])
.minus(marketStatistics[TOTAL_CONFIRMATIONS_24H])
Expand Down Expand Up @@ -264,17 +263,15 @@ const HomePage = () => {
<Card
size="small"
title={

<span>
{is24Hours ?t("pages.home.last24Hours"): t("pages.home.last7Days")}
<Tooltip
placement="right"
title={is24Hours ? t("tooltips.last24Hours") : t("tooltips.last7days")}
>
<QuestionCircle />
</Tooltip>
</span>

<span>
{is24Hours ? t("pages.home.last24Hours") : t("pages.home.last7Days")}
<Tooltip
placement="right"
title={is24Hours ? t("tooltips.last24Hours") : t("tooltips.last7days")}
>
<QuestionCircle />
</Tooltip>
</span>
}
extra={
isFeatureActive ? (
Expand All @@ -297,19 +294,15 @@ const HomePage = () => {
isMarketStatisticsError ||
!onChainVolumeChange24h
}
tooltip={t<string>("tooltips.onChainVolume")}
tooltip={t("tooltips.onChainVolume") as string}
title={t("pages.home.onChainVolume")}
suffix={
<StatisticsChange
value={is24Hours ? onChainVolumeChange24h : onChainVolumeChange7d}
isPercent
/>
}
value={new BigNumber(
is24Hours
? marketStatistics[TOTAL_VOLUME_24H]
: marketStatistics[TOTAL_VOLUME_7D],
)
value={new BigNumber(is24Hours?marketStatistics[TOTAL_VOLUME_24H]:marketStatistics[TOTAL_VOLUME_7D])
.decimalPlaces(5)
.toNumber()}
/>
Expand All @@ -327,7 +320,11 @@ const HomePage = () => {
isPercent
/>
}
value={marketStatistics[TOTAL_CONFIRMATIONS_24H]}
value={
is24Hours
? marketStatistics[TOTAL_CONFIRMATIONS_24H]
: marketStatistics[TOTAL_CONFIRMATIONS_7D]
}
/>
{isSmallAndLower ? (
<LoadingStatistic
Expand Down

0 comments on commit 853a161

Please sign in to comment.