add outbox status to overview

This commit is contained in:
marlon-erler
2024-07-11 20:16:28 +02:00
parent 0675447413
commit 9d24cd7ebd
8 changed files with 337 additions and 215 deletions
+10
View File
@@ -3,6 +3,7 @@ import * as React from "bloatless-react";
import { Chat, createChatWithName } from "./chatModel";
import UDNFrontend from "udn-frontend";
import { translation } from "../translations";
export const UDN = new UDNFrontend();
@@ -130,6 +131,15 @@ UDN.onmailboxdelete = () => {
subscribeChannels();
};
// OUTBOX
export const outboxItemCount = new React.State(0);
export const outboxText = React.createProxyState([outboxItemCount], () =>
translation.outboxText(outboxItemCount.value)
);
export const outboxTextStyle = React.createProxyState([outboxItemCount], () =>
outboxItemCount.value == 0 ? "success" : "warning"
);
// MISC
export const isEncryptionAvailable = window.crypto.subtle != undefined;
export const senderName = React.restoreState("sender-name", "");