summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src/wallet/Notifications/views.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet/Notifications/views.tsx')
-rw-r--r--packages/taler-wallet-webextension/src/wallet/Notifications/views.tsx23
1 files changed, 7 insertions, 16 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/Notifications/views.tsx b/packages/taler-wallet-webextension/src/wallet/Notifications/views.tsx
index 9146d8837..03a08016a 100644
--- a/packages/taler-wallet-webextension/src/wallet/Notifications/views.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/Notifications/views.tsx
@@ -20,7 +20,6 @@ import {
AttentionType,
} from "@gnu-taler/taler-util";
import { Fragment, h, VNode } from "preact";
-import { LoadingError } from "../../components/LoadingError.js";
import {
Column,
DateSeparator,
@@ -29,7 +28,7 @@ import {
SmallLightText,
} from "../../components/styled/index.js";
import { Time } from "../../components/Time.js";
-import { useTranslationContext } from "../../context/translation.js";
+import { useTranslationContext } from "@gnu-taler/web-util/browser";
import { Avatar } from "../../mui/Avatar.js";
import { Button } from "../../mui/Button.js";
import { Grid } from "../../mui/Grid.js";
@@ -37,17 +36,6 @@ import { Pages } from "../../NavigationBar.js";
import { assertUnreachable } from "../../utils/index.js";
import { State } from "./index.js";
-export function LoadingUriView({ error }: State.LoadingUriError): VNode {
- const { i18n } = useTranslationContext();
-
- return (
- <LoadingError
- title={<i18n.Translate>Could not load notifications</i18n.Translate>}
- error={error}
- />
- );
-}
-
const term = 1000 * 60 * 60 * 24;
function normalizeToDay(x: number): number {
return Math.round(x / term) * term;
@@ -64,7 +52,8 @@ export function ReadyView({ list }: State.Ready): VNode {
}
const byDate = list.reduce((rv, x) => {
- const theDate = x.when.t_ms === "never" ? 0 : normalizeToDay(x.when.t_ms);
+ const theDate =
+ x.when.t_s === "never" ? 0 : normalizeToDay(x.when.t_s * 1000);
if (theDate) {
(rv[theDate] = rv[theDate] || []).push(x);
}
@@ -80,7 +69,9 @@ export function ReadyView({ list }: State.Ready): VNode {
<Fragment key={i}>
<DateSeparator>
<Time
- timestamp={{ t_ms: Number.parseInt(d, 10) }}
+ timestamp={AbsoluteTime.fromMilliseconds(
+ Number.parseInt(d, 10),
+ )}
format="dd MMMM yyyy"
/>
</DateSeparator>
@@ -89,7 +80,7 @@ export function ReadyView({ list }: State.Ready): VNode {
key={i}
info={n.info}
isRead={n.read}
- timestamp={n.when}
+ timestamp={AbsoluteTime.fromPreciseTimestamp(n.when)}
/>
))}
</Fragment>