correct type issues

This commit is contained in:
marlon-erler
2026-09-09 00:04:27 +02:00
parent 4631730f02
commit 839e887d85
24 changed files with 511 additions and 437 deletions
+56 -18
View File
@@ -605,9 +605,9 @@
exportHeadline: "Daten exportieren",
importHeadline: "Daten importieren",
selectionDescription: "W\xE4hle die Daten aus, die du \xFCbertragen m\xF6chtest.",
exportSelectionDescription: "W\xE4hle die Daten aus, die du exportieren m\xF6chtest.",
dataEntryDescription: "Gib diese Informationen auf dem anderen Ger\xE4t ein.",
dataEntryInputDescription: "Gib die auf dem anderen Ger\xE4t angezeigten Informationen ein.",
notConnectedError: "Du bist mit keinem Server verbunden.",
fromThisDeviceButton: "An anderes Ger\xE4t senden",
toThisDeviceButton: "An dieses Ger\xE4t senden",
exportButton: "Als Datei exportieren",
@@ -622,7 +622,13 @@
sendAgainButton: "Erneut senden",
filesSentCount: (count) => `Dateien gesendet: ${count}.`,
allFilesSent: "Fertig.",
filesReceivedCount: (count) => `Dateien empfangen: ${count}.`
filesReceivedCount: (count) => `Dateien empfangen: ${count}.`,
exportKey: "Schl\xFCssel",
exportKeyConfirmation: "Schl\xFCssel best\xE4tigen",
downloadFileButton: "Herunterladen",
importFileButton: "Importieren",
decryptImportButton: "Entschl\xFCsseln",
incorrectPassphraseError: "Der Schl\xFCssel ist nicht korrekt"
},
storage: {
noItemSelected: "Kein Element ausgew\xE4hlt",
@@ -814,9 +820,9 @@
exportHeadline: "Exportar archivo",
importHeadline: "Importar archivo",
selectionDescription: "Selecciona los datos que quieres transferir.",
exportSelectionDescription: "Selecciona los datos que quieres exportar.",
dataEntryDescription: "Introduce estos datos en el otro dispositivo.",
dataEntryInputDescription: "Introduce los datos mostrados en el otro dispositivo.",
notConnectedError: "No est\xE1s conectado a ning\xFAn servidor.",
fromThisDeviceButton: "Enviar a otro dispositivo",
toThisDeviceButton: "Enviar a este dispositivo",
exportButton: "Exportar archivo",
@@ -826,12 +832,18 @@
settingsData: "Datos de Configuraci\xF3n",
chatsHeadline: "Chats",
transferChannelHeadline: "Canal de Transferencia",
transferKeyHeadline: "Clave de Encriptaci\xF3n de Transferencia",
transferKeyHeadline: "Clave de encriptaci\xF3n de transferencia",
sendButton: "Enviar",
sendAgainButton: "Enviar otra vez",
filesSentCount: (count) => `Archivos enviados: ${count}.`,
allFilesSent: "Hecho.",
filesReceivedCount: (count) => `Archivos recibidos: ${count}.`
filesReceivedCount: (count) => `Archivos recibidos: ${count}.`,
exportKey: "Clave de encriptaci\xF3n",
exportKeyConfirmation: "Confirmar clave",
downloadFileButton: "Descargar",
importFileButton: "Importar",
decryptImportButton: "Descifrar",
incorrectPassphraseError: "La clave no es correcta"
},
storage: {
noItemSelected: "Ning\xFAn elemento seleccionado",
@@ -1162,6 +1174,8 @@
const point = (e, direction, i) => e.touches[i][direction == "x" ? "clientX" : "clientY"];
const midpoint = (e, direction) => (point(e, direction, 0) + point(e, direction, 1)) / 2;
function apply(factor, _offset) {
const el = element();
if (!el) return;
if (factor < MIN) return apply(MIN, _offset);
if (factor > MAX) return apply(5, _offset);
let x, y;
@@ -1170,7 +1184,7 @@
x = currentX;
y = currentY;
}
element().style.transform = `scale(${factor.toString()}) translate(${x}px, ${y}px)`;
el.style.transform = `scale(${factor.toString()}) translate(${x}px, ${y}px)`;
currentX = x;
currentY = y;
currentZoom = factor;
@@ -1194,8 +1208,10 @@
});
canvas.addEventListener("touchstart", (event) => {
document.activeElement.blur();
if (lastElement != void 0 && lastElement != element()) reset();
lastElement = element();
const el = element();
if (!el) return;
if (lastElement != void 0 && lastElement != el) reset();
lastElement = el;
initialZoom = currentZoom;
initialX = currentX;
initialY = currentY;
@@ -1241,7 +1257,7 @@
this.connectionModel = connectionModel2;
this.chatListModel = chatListModel2;
this.fileTransferModel = fileTransferModel2;
this.BUILD = "Build 26.09.06.A";
this.BUILD = "Build 26.09.09.A";
// CONTEXT
this.contextStack = /* @__PURE__ */ new Map();
this.closeContext = (contextId, fromHistoryEvent = false) => {
@@ -1249,6 +1265,7 @@
return;
while (this.contexts.length > 0) {
const currentContext = this.context;
if (!currentContext) return;
currentContext.handleContextClose(fromHistoryEvent);
this.contextStack.delete(currentContext.contextId);
if (currentContext.contextId == contextId) break;
@@ -1260,7 +1277,7 @@
const contexts = this.contexts;
while (contexts.length > 0) {
const currentContext = contexts.pop();
if (!currentContext) contexts;
if (!currentContext) return;
const isHandled = currentContext.handleKeystroke(e);
if (isHandled == true) break;
}
@@ -1287,6 +1304,7 @@
this.translations = allTranslations[settingsModel2.language] || allTranslations.en;
document.body.addEventListener("keydown", this.handleKeyDown);
window.onpopstate = () => {
if (!this.context) return;
this.closeContext(this.context.contextId, true);
};
this.startChron();
@@ -1337,8 +1355,9 @@
}
};
var ContextHost = class extends Context {
constructor() {
super(...arguments);
constructor(contextDebugDescription, coreViewModel2) {
super(contextDebugDescription);
this.coreViewModel = coreViewModel2;
this.contexts = /* @__PURE__ */ new Map();
this.currentContext = new State(void 0);
this.registerContext = (key, context) => {
@@ -1354,8 +1373,10 @@
};
this.updateContexts = () => {
if (this.isOpen == false) return;
const selection = this.contextSelection;
if (!selection) return;
const selectedContext = this.contexts.get(
this.contextSelection
selection
);
if (!selectedContext) return;
if (selectedContext != this.currentContext.value) {
@@ -1657,6 +1678,11 @@
var SettingsModel = class _SettingsModel {
// init
constructor(storageModel2) {
// data
this.username = "";
this.firstDayOfWeek = "";
this.language = "";
this.theme = "";
// storage
this.storeSetting = (pathName, value) => {
const path = StorageModel.getPath(
@@ -1943,6 +1969,7 @@
const input = document.getElementById("file-transfer-input");
if (!input) return;
if (!(input instanceof HTMLInputElement)) return;
if (!input.files) return;
const file = input.files[0];
this.importedFile.value = file;
};
@@ -1953,6 +1980,7 @@
reader.readAsText(file, "utf8");
reader.onload = () => {
const result = reader.result;
if (!result) return;
this.importedFileString.value = result.toString();
this.showImportDecryptDataModal();
};
@@ -3183,7 +3211,7 @@
var TaskPageViewModel = class extends ContextHost {
// init
constructor(coreViewModel2, chatViewModel, boardsAndTasksModel) {
super("task-page");
super("task-page", coreViewModel2);
this.coreViewModel = coreViewModel2;
this.chatViewModel = chatViewModel;
this.boardsAndTasksModel = boardsAndTasksModel;
@@ -3508,6 +3536,8 @@
var ChatModel = class _ChatModel {
// init
constructor(storageModel2, connectionModel2, settingsModel2, chatListModel2, chatId) {
/* load function called in constructor */
this.color = "standard" /* Standard */;
// handler managers
this.chatMessageHandlerManager = new HandlerManager();
this.reactionHandlerManager = new HandlerManager();
@@ -3622,7 +3652,7 @@
};
this.sendMessage = async (body, inlineReplyId, fileContent) => {
const nameAndChannel = this.getNameAndChannel();
if (nameAndChannel == false) return;
if (nameAndChannel == false) return false;
const [senderName, combinedChannel] = nameAndChannel;
const chatMessage = await _ChatModel.createChatMessage(
combinedChannel,
@@ -3648,10 +3678,10 @@
chatMessage.body = decryptedBody;
chatMessage.stringifiedFile = decryptedFile;
};
this.sendReaction = async (messageId, content, isDeleting) => {
this.sendReaction = async (messageId, content, isDeleting = false) => {
const nameAndChannel = this.getNameAndChannel();
if (nameAndChannel == false) return;
const [senderName, combinedChannel] = nameAndChannel;
const [senderName] = nameAndChannel;
const reaction = _ChatModel.createMessageReaction(
messageId,
senderName,
@@ -3860,6 +3890,9 @@
constructor(coreViewModel2, messagePageViewModel, chatMessage, sentByUser) {
this.coreViewModel = coreViewModel2;
this.messagePageViewModel = messagePageViewModel;
this.channel = "";
this.sender = "";
this.dateSent = "";
this.body = new State("");
this.inlineReply = void 0;
this.status = new State(
@@ -4314,7 +4347,7 @@
var ChatViewModel6 = class extends ContextHost {
// init
constructor(coreViewModel2, chatModel, settingsViewModel2, notificationViewModel, connectionViewModel2, chatListViewModel2) {
super("chat");
super("chat", coreViewModel2);
this.coreViewModel = coreViewModel2;
this.chatModel = chatModel;
this.settingsViewModel = settingsViewModel2;
@@ -4498,6 +4531,7 @@
].find(
(chat2) => chat2.chatModel.unwrappedPrimaryChannel == notification.chat
);
if (!chat) return;
chat.open();
chat.openPage("messages" /* Messages */);
};
@@ -4508,6 +4542,7 @@
return this.stopLoop();
}
const notification = this.messagesInMarquee.shift();
if (!notification) return;
this.seenMessageIds.delete(notification.messageId);
this.marquee.value = notification;
};
@@ -6573,6 +6608,7 @@
// src/View/Modals/splitModal.tsx
function SplitModal(coreViewModel2, leftView, rightView, extendedStyle = false, navigationState) {
function closePage() {
if (!navigationState) return;
navigationState.value = void 0;
}
const hasPageOpen = new State(false);
@@ -7531,6 +7567,7 @@
return transferData;
};
this.prepareToSend = () => {
if (!this.transferData) return;
this.direction = 0 /* Send */;
this.connectionModel.addChannel(this.transferData.channel);
};
@@ -7627,6 +7664,7 @@
return stringify(fileData);
};
this.sendFile = async (stringifiedFileData) => {
if (!this.transferData) return;
const encryptedFileData = await encryptString(
stringifiedFileData,
this.transferData.key
Binary file not shown.
+5 -5
View File
@@ -34,8 +34,8 @@ export default class ChatModel {
// data
readonly id: string;
info: ChatInfo;
color: Colors;
info: ChatInfo; /* load function called in constructor */
color: Colors = Colors.Standard;
get unwrappedPrimaryChannel(): string {
return this.info.namespace + this.info.primaryChannel;
@@ -196,7 +196,7 @@ export default class ChatModel {
fileContent?: FileContent<string>,
): Promise<boolean> => {
const nameAndChannel = this.getNameAndChannel();
if (nameAndChannel == false) return;
if (nameAndChannel == false) return false;
const [senderName, combinedChannel] = nameAndChannel;
const chatMessage: ChatMessage = await ChatModel.createChatMessage(
@@ -231,11 +231,11 @@ export default class ChatModel {
readonly sendReaction = async (
messageId: string,
content: ReactionSymbols,
isDeleting?: boolean,
isDeleting: boolean = false,
): Promise<void> => {
const nameAndChannel = this.getNameAndChannel();
if (nameAndChannel == false) return;
const [senderName, combinedChannel] = nameAndChannel;
const [senderName] = nameAndChannel;
const reaction = ChatModel.createMessageReaction(
messageId,
+4 -1
View File
@@ -37,6 +37,7 @@ export default class FileTransferModel {
};
readonly prepareToSend = (): void => {
if (!this.transferData) return;
this.direction = TransferDirections.Send;
this.connectionModel.addChannel(this.transferData.channel);
};
@@ -156,7 +157,7 @@ export default class FileTransferModel {
};
readonly prepareFileForSending = (filePath: string[]): string => {
const fileContent: string | undefined =
const fileContent: string | null =
this.storageModel.read(filePath);
if (fileContent == null) return "";
@@ -168,6 +169,8 @@ export default class FileTransferModel {
};
readonly sendFile = async (stringifiedFileData: string): Promise<void> => {
if (!this.transferData) return;
const encryptedFileData: string = await encryptString(
stringifiedFileData,
this.transferData.key,
+5 -5
View File
@@ -6,10 +6,10 @@ export default class SettingsModel {
readonly storageModel: StorageModel;
// data
username: string;
firstDayOfWeek: string;
language: string;
theme: string;
username: string = "";
firstDayOfWeek: string = "";
language: string = "";
theme: string = "";
// storage
private readonly storeSetting = (
@@ -46,7 +46,7 @@ export default class SettingsModel {
// load
private readonly readSetting = (
pathName: keyof typeof filePaths.settingsModel,
): string => {
): string|null=> {
const path = StorageModel.getPath(
StorageModelSubPaths.SettingsModel,
filePaths.settingsModel[pathName],
Binary file not shown.
+17 -13
View File
@@ -313,20 +313,22 @@ export function implementPinchZoom(canvas: HTMLElement) {
const MIN = 0.25;
const MAX = 5;
const element = (): HTMLElement => canvas.querySelector(".zoom");
const element = (): HTMLElement|null=> canvas.querySelector(".zoom");
const distance = (e: TouchEvent) =>
Math.hypot(
e.touches[0].pageX - e.touches[1].pageX,
e.touches[0].pageY - e.touches[1].pageY,
);
Math.hypot(
e.touches[0].pageX - e.touches[1].pageX,
e.touches[0].pageY - e.touches[1].pageY,
);
const point = (e: TouchEvent, direction: "x" | "y", i: number) =>
e.touches[i][direction == "x" ? "clientX" : "clientY"];
e.touches[i][direction == "x" ? "clientX" : "clientY"];
const midpoint = (e: TouchEvent, direction: "x" | "y") =>
(point(e, direction, 0) + point(e, direction, 1)) / 2;
(point(e, direction, 0) + point(e, direction, 1)) / 2;
function apply(factor: number, _offset?: [number, number]) {
if (factor < MIN) return apply(MIN, _offset);
if (factor > MAX) return apply(5, _offset);
const el = element();
if (!el) return;
if (factor < MIN) return apply(MIN, _offset);
if (factor > MAX) return apply(5, _offset);
let x: number, y: number;
if (_offset) [x, y] = _offset;
@@ -334,7 +336,7 @@ export function implementPinchZoom(canvas: HTMLElement) {
x = currentX
y = currentY
}
element().style.transform = `scale(${factor.toString()}) translate(${x}px, ${y}px)`;
el.style.transform = `scale(${factor.toString()}) translate(${x}px, ${y}px)`;
currentX = x;
currentY = y;
currentZoom = factor;
@@ -356,15 +358,17 @@ export function implementPinchZoom(canvas: HTMLElement) {
}
apply(currentZoom - event.deltaY * 0.01);
});
canvas.addEventListener("scroll", (event: MouseEvent) => {
canvas.addEventListener("scroll", (event: Event) => {
event.preventDefault();
});
canvas.addEventListener("touchstart", (event: TouchEvent) => {
(document.activeElement as HTMLElement).blur();
if (lastElement != undefined && lastElement != element()) reset();
lastElement = element();
const el = element();
if (!el) return;
if (lastElement != undefined && lastElement != el) reset();
lastElement = el;
initialZoom = currentZoom;
initialX = currentX;
+1 -1
View File
@@ -169,7 +169,7 @@ function SettingsAppearancePane(
<h2>{coreViewModel.translations.settings.pages.appearance}</h2>
<hr></hr>
{OptionButtonList(
new React.ListState<[string, ThemeSettings]>([
new React.ListState<[string, string]>([
[
coreViewModel.translations.settings.themes.dark,
ThemeSettings.Dark,
+1
View File
@@ -10,6 +10,7 @@ export function SplitModal<T>(
navigationState?: React.State<T | undefined>,
) {
function closePage() {
if (!navigationState) return;
navigationState.value = undefined;
}
+382 -368
View File
@@ -435,13 +435,13 @@ export const allTranslations: {
importHeadline: "Daten importieren",
selectionDescription:
"Wähle die Daten aus, die du übertragen möchtest.",
exportSelectionDescription:
"Wähle die Daten aus, die du exportieren möchtest.",
dataEntryDescription:
"Gib diese Informationen auf dem anderen Gerät ein.",
dataEntryInputDescription:
"Gib die auf dem anderen Gerät angezeigten Informationen ein.",
notConnectedError: "Du bist mit keinem Server verbunden.",
fromThisDeviceButton: "An anderes Gerät senden",
toThisDeviceButton: "An dieses Gerät senden",
exportButton: "Als Datei exportieren",
@@ -463,448 +463,462 @@ export const allTranslations: {
filesSentCount: (count) => `Dateien gesendet: ${count}.`,
allFilesSent: "Fertig.",
filesReceivedCount: (count) => `Dateien empfangen: ${count}.`,
},
filesReceivedCount: (count) => `Dateien empfangen: ${count}.`,
storage: {
noItemSelected: "Kein Element ausgewählt",
notAFile: "(keine Datei)",
contentEmpty: "(leer)",
exportKey: "Schlüssel",
exportKeyConfirmation: "Schlüssel bestätigen",
downloadFileButton: "Herunterladen",
importFileButton: "Importieren",
decryptImportButton: "Entschlüsseln",
incorrectPassphraseError: "Der Schlüssel ist nicht korrekt"
},
path: "Pfad",
content: "Inhalt",
storage: {
noItemSelected: "Kein Element ausgewählt",
notAFile: "(keine Datei)",
contentEmpty: "(leer)",
deleteItem: "Element löschen",
path: "Pfad",
content: "Inhalt",
removeJunkButton: "Datenmüll löschen",
},
deleteItem: "Element löschen",
chatPage: {
closeChatAudioLabe: "Chat schließen",
chatSettingsAudioLabel: "Chateinstellungen",
removeJunkButton: "Datenmüll löschen",
},
pages: {
settings: "Einstellungen",
messages: "Nachrichten",
tasks: "Aufgaben",
calendar: "Kalender",
},
chatPage: {
closeChatAudioLabe: "Chat schließen",
chatSettingsAudioLabel: "Chateinstellungen",
settings: {
settingsHeadline: "Einstellungen",
pages: {
settings: "Einstellungen",
messages: "Nachrichten",
tasks: "Aufgaben",
calendar: "Kalender",
},
primaryChannelLabel: "Hauptkanal",
setPrimaryChannelButtonAudioLabel: "Hauptkanal festlegen",
settings: {
settingsHeadline: "Einstellungen",
namespaceLabel: "Namensraum",
namespacePlaceholder: "Ohne Namensraum",
setNamespaceButtonAudioLabel: "Namensraum festlegen",
primaryChannelLabel: "Hauptkanal",
setPrimaryChannelButtonAudioLabel: "Hauptkanal festlegen",
newSecondaryChannelPlaceholder: "Sekundären Kanal hinzufügen",
newSecondaryChannelAudioLabel:
"Name des neuen sekundären Kanals",
addSecondaryChannelButtonAudioLabel:
"Sekundären Kanal hinzufügen",
namespaceLabel: "Namensraum",
namespacePlaceholder: "Ohne Namensraum",
setNamespaceButtonAudioLabel: "Namensraum festlegen",
encryptionKeyLabel: "Schlüssel",
setEncryptionKeyButtonAudioLabel: "Schlüssel festlegen",
showEncryptionKey: "Schlüssel anzeigen",
newSecondaryChannelPlaceholder: "Sekundären Kanal hinzufügen",
newSecondaryChannelAudioLabel:
"Name des neuen sekundären Kanals",
addSecondaryChannelButtonAudioLabel:
"Sekundären Kanal hinzufügen",
deleteChatButton: "Gesamten Chat löschen",
},
encryptionKeyLabel: "Schlüssel",
setEncryptionKeyButtonAudioLabel: "Schlüssel festlegen",
showEncryptionKey: "Schlüssel anzeigen",
message: {
messagesHeadline: "Nachrichten",
deleteChatButton: "Gesamten Chat löschen",
},
messageFilterHeadline: "Nachrichten filtern",
messageFilterReactionsHadline: "Reaktionen",
messageFilterAllReactionsButton: "Alle anzeigen",
message: {
messagesHeadline: "Nachrichten",
composerInputPlaceholder: "Schreib eine Nachricht...",
sendMessageButtonAudioLabel: "nachricht senden",
filterMessagesButtonAudioLabel: "nachrichten filtern",
messageFilterHeadline: "Nachrichten filtern",
messageFilterReactionsHadline: "Reaktionen",
messageFilterAllReactionsButton: "Alle anzeigen",
showMessageInfoButtonAudioLabel: "nachrichteninfo anzeigen",
messageInfoHeadline: "Nachrichteninfo",
cancelReplyAudioLabel: "antwort abbrechen",
composerInputPlaceholder: "Schreib eine Nachricht...",
sendMessageButtonAudioLabel: "nachricht senden",
filterMessagesButtonAudioLabel: "nachrichten filtern",
sentBy: "Gesendet von",
timeSent: "Sendezeit",
channel: "Kanal",
messageContent: "Nachrichteninhalt",
showMessageInfoButtonAudioLabel: "nachrichteninfo anzeigen",
messageInfoHeadline: "Nachrichteninfo",
cancelReplyAudioLabel: "antwort abbrechen",
copyMessageButton: "Nachricht kopieren",
resendMessageButton: "Nachricht erneut senden",
decryptMessageButton: "Nachricht entschlüsseln",
replyToMessageButton: "Auf Nachricht antworten",
deleteMessageButton: "Nachricht löschen",
sentBy: "Gesendet von",
timeSent: "Sendezeit",
channel: "Kanal",
messageContent: "Nachrichteninhalt",
//
copyMessageButton: "Nachricht kopieren",
resendMessageButton: "Nachricht erneut senden",
decryptMessageButton: "Nachricht entschlüsseln",
replyToMessageButton: "Auf Nachricht antworten",
deleteMessageButton: "Nachricht löschen",
thumbsUpReaction: "Reaktion: Daumen hoch",
checkReaction: "Reaktion: Haken",
stopReaction: "Reaktion: Stopp",
attentionReaction: "Reaktion: Ausrufezeichen",
doubleAttentionReaction: "Reaktion: doppeltes Ausrufezeichen",
questionReaction: "Reaktion: Fragezeichen",
},
//
task: {
newBoardNamePlaceholder: "Board erstellen",
createBoardButtonAudioLabel: "board erstellen",
thumbsUpReaction: "Reaktion: Daumen hoch",
checkReaction: "Reaktion: Haken",
stopReaction: "Reaktion: Stopp",
attentionReaction: "Reaktion: Ausrufezeichen",
doubleAttentionReaction: "Reaktion: doppeltes Ausrufezeichen",
questionReaction: "Reaktion: Fragezeichen",
},
noBoardSelected: "Kein Board ausgewählt",
boardNotFound: "Board nicht gefunden",
task: {
newBoardNamePlaceholder: "Board erstellen",
createBoardButtonAudioLabel: "board erstellen",
closeBoardButtonAudioLabel: "board schließen",
toggleBoardButtonAudioLabel: "board-liste ein/ausblenden",
showBoardSettingsButtonAudioLabel:
"Board-Einstellungen anzeigen",
noBoardSelected: "Kein Board ausgewählt",
boardNotFound: "Board nicht gefunden",
listViewButtonAudioLabel: "Listenansicht",
kanbanViewButtonAudioLabel: "Kanban-Ansicht",
statusViewButtonAudioLabel: "Statusrasteransicht",
closeBoardButtonAudioLabel: "board schließen",
toggleBoardButtonAudioLabel: "board-liste ein/ausblenden",
showBoardSettingsButtonAudioLabel:
"Board-Einstellungen anzeigen",
filterTasksButtonAudioLabel: "Aufgaben filtern",
createTaskButtonAudioLabel: "Neue Aufgabe erstellen",
listViewButtonAudioLabel: "Listenansicht",
kanbanViewButtonAudioLabel: "Kanban-Ansicht",
statusViewButtonAudioLabel: "Statusrasteransicht",
boardSettingsHeadline: "Board-Einstellungen",
boardNameInputLabel: "Boardname",
deleteBoardButton: "Board und alle Aufgaben löschen",
filterTasksButtonAudioLabel: "Aufgaben filtern",
createTaskButtonAudioLabel: "Neue Aufgabe erstellen",
taskSettingsHeadline: "Aufgabe bearbeiten",
boardSettingsHeadline: "Board-Einstellungen",
boardNameInputLabel: "Boardname",
deleteBoardButton: "Board und alle Aufgaben löschen",
taskNameLabel: "Titel",
taskBoardLabel: "Board",
taskSettingsHeadline: "Aufgabe bearbeiten",
taskCategoryLabel: "Kategorie",
taskStatusLabel: "Status",
taskPriorityLabel: "Priorität",
taskNameLabel: "Titel",
taskBoardLabel: "Board",
taskDescriptionLabel: "Beschreibung",
taskCategoryLabel: "Kategorie",
taskStatusLabel: "Status",
taskPriorityLabel: "Priorität",
taskDateLabel: "Datum",
taskTimeLabel: "Uhrzeit",
taskDescriptionLabel: "Beschreibung",
deleteTaskButton: "Aufgabe löschen",
taskDateLabel: "Datum",
taskTimeLabel: "Uhrzeit",
filterTasksHeadline: "Aufgaben filtern",
deleteTaskButton: "Aufgabe löschen",
renameCategoryInputPlaceholder: "Kategorie umbenennen",
renameStatusInputPlaceholder: "Status umbenennen",
},
filterTasksHeadline: "Aufgaben filtern",
calendar: {
eventsBoard: "Ereignisse",
renameCategoryInputPlaceholder: "Kategorie umbenennen",
renameStatusInputPlaceholder: "Status umbenennen",
},
///
calendar: {
eventsBoard: "Ereignisse",
todayButtonAudioLabel: "gehe zu heute",
///
previousMonthButtonAudioLabel: "vorheriger monat",
nextMonthButtonAudioLabel: "nächster monat",
todayButtonAudioLabel: "gehe zu heute",
yearInputAudioLabel: "Jahr",
monthInputAudioLabel: "Monat",
previousMonthButtonAudioLabel: "vorheriger monat",
nextMonthButtonAudioLabel: "nächster monat",
yearInputPlaceholder: "2000",
monthInputPlaceholder: "01",
yearInputAudioLabel: "Jahr",
monthInputAudioLabel: "Monat",
searchEventsHeadline: "Ereignisse suchen",
yearInputPlaceholder: "2000",
monthInputPlaceholder: "01",
events: "Ereignisse",
noEvents: "Keine Ereignisse",
},
},
searchEventsHeadline: "Ereignisse suchen",
events: "Ereignisse",
noEvents: "Keine Ereignisse",
},
},
},
es: {
updater: {
migrated: "Migrado",
},
general: {
deleteItemButtonAudioLabel: "eliminar elemento",
searchButtonAudioLabel: "buscar",
abortButton: "Abortar",
cancelButton: "Cancelar",
closeButton: "Cerrar",
backButton: "Atrás",
continueButton: "Continuar",
confirmButton: "Confirmar",
saveButton: "Guardar",
setButton: "OK",
reloadAppButton: "Recargar app",
fileVersionLabel: "Versión",
searchLabel: "Buscar",
waitingLabel: "Esperando...",
restoreConnection: "Conectar de nuevo",
noPageSelected: "No página seleccionada",
},
regional: {
weekdays: {
full: [
"Domingo",
"Lunes",
"Martes",
"Miércoles",
"Jueves",
"Viernes",
"Sábado",
],
abbreviated: ["Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb"],
},
},
homePage: {
appName: "Comms",
overviewHeadline: "Resumen",
serverAddress: "Dirección del servidor",
serverAddressPlaceholder: "wss://192.168.0.69:3000",
connectAudioLabel: "conectar al servidor",
disconnectAudioLabel: "desconectar del servidor",
manageConnectionsAudioLabel: "gestionar conexiones",
yourNameLabel: "Tu nombre",
yourNamePlaceholder: "Juan Pérez",
setNameButtonAudioLabel: "establecer nombre",
settingsButton: "Ajustes",
manageStorageButton: "Gestionar almacenamiento",
transferDataButton: "Enviar o exportar archivos",
scrollToChatButton: "Chats",
backToOverviewAudioLabel: "volver al resumen",
chatsHeadline: "Chats",
addChatAudioLabel: "nombre del nuevo chat",
addChatPlaceholder: "Añadir chat",
addChatButton: "Añadir chat",
},
settings: {
pages: {
appearance: "Aspecto",
regional: "Idioma y Región",
info: "Sobre Comms",
},
themes: {
dark: "Oscuro",
light: "Claro",
system: "Según dispositivo",
},
version: "Versión",
language: "Idioma",
firstDayOfWeekLabel: "Primer día de la semana",
},
connectionModal: {
connectionModalHeadline: "Gestionar Conexiones",
connectButtonAudioLabel: "conectar",
},
dataTransferModal: {
transferDataHeadline: "Transferencia de datos",
sendHeadline: "Enviar a otro dispositivo",
receiveHeadline: "Enviar a este dispositivo",
exportHeadline: "Exportar archivo",
importHeadline: "Importar archivo",
selectionDescription:
"Selecciona los datos que quieres transferir.",
dataEntryDescription:
"Introduce estos datos en el otro dispositivo.",
dataEntryInputDescription:
"Introduce los datos mostrados en el otro dispositivo.",
notConnectedError: "No estás conectado a ningún servidor.",
fromThisDeviceButton: "Enviar a otro dispositivo",
toThisDeviceButton: "Enviar a este dispositivo",
exportButton: "Exportar archivo",
importButton: "Importar archivo",
generalHeadline: "General",
connectionData: "Datos de Conexión",
settingsData: "Datos de Configuración",
chatsHeadline: "Chats",
transferChannelHeadline: "Canal de Transferencia",
transferKeyHeadline: "Clave de Encriptación de Transferencia",
sendButton: "Enviar",
sendAgainButton: "Enviar otra vez",
filesSentCount: (count) => `Archivos enviados: ${count}.`,
allFilesSent: "Hecho.",
filesReceivedCount: (count) => `Archivos recibidos: ${count}.`,
},
storage: {
noItemSelected: "Ningún elemento seleccionado",
notAFile: "(no es un archivo)",
contentEmpty: "(vacío)",
path: "Ruta",
content: "Contenido",
deleteItem: "Eliminar elemento",
removeJunkButton: "Eliminar archivos basura",
},
chatPage: {
closeChatAudioLabe: "cerrar chat",
chatSettingsAudioLabel: "configuración del chat",
pages: {
settings: "Configuración",
messages: "Mensajes",
tasks: "Tareas",
calendar: "Calendario",
},
updater: {
migrated: "Migrado",
},
general: {
deleteItemButtonAudioLabel: "eliminar elemento",
searchButtonAudioLabel: "buscar",
abortButton: "Abortar",
cancelButton: "Cancelar",
closeButton: "Cerrar",
backButton: "Atrás",
continueButton: "Continuar",
confirmButton: "Confirmar",
saveButton: "Guardar",
setButton: "OK",
reloadAppButton: "Recargar app",
fileVersionLabel: "Versión",
searchLabel: "Buscar",
waitingLabel: "Esperando...",
restoreConnection: "Conectar de nuevo",
noPageSelected: "No página seleccionada",
},
regional: {
weekdays: {
full: [
"Domingo",
"Lunes",
"Martes",
"Miércoles",
"Jueves",
"Viernes",
"Sábado",
],
abbreviated: ["Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb"],
},
},
homePage: {
appName: "Comms",
overviewHeadline: "Resumen",
serverAddress: "Dirección del servidor",
serverAddressPlaceholder: "wss://192.168.0.69:3000",
connectAudioLabel: "conectar al servidor",
disconnectAudioLabel: "desconectar del servidor",
manageConnectionsAudioLabel: "gestionar conexiones",
yourNameLabel: "Tu nombre",
yourNamePlaceholder: "Juan Pérez",
setNameButtonAudioLabel: "establecer nombre",
settingsButton: "Ajustes",
manageStorageButton: "Gestionar almacenamiento",
transferDataButton: "Enviar o exportar archivos",
scrollToChatButton: "Chats",
backToOverviewAudioLabel: "volver al resumen",
chatsHeadline: "Chats",
addChatAudioLabel: "nombre del nuevo chat",
addChatPlaceholder: "Añadir chat",
addChatButton: "Añadir chat",
},
settings: {
pages: {
appearance: "Aspecto",
regional: "Idioma y Región",
info: "Sobre Comms",
},
themes: {
dark: "Oscuro",
light: "Claro",
system: "Según dispositivo",
},
version: "Versión",
language: "Idioma",
firstDayOfWeekLabel: "Primer día de la semana",
},
connectionModal: {
connectionModalHeadline: "Gestionar Conexiones",
connectButtonAudioLabel: "conectar",
},
dataTransferModal: {
transferDataHeadline: "Transferencia de datos",
sendHeadline: "Enviar a otro dispositivo",
receiveHeadline: "Enviar a este dispositivo",
exportHeadline: "Exportar archivo",
importHeadline: "Importar archivo",
selectionDescription:
"Selecciona los datos que quieres transferir.",
exportSelectionDescription:
"Selecciona los datos que quieres exportar.",
dataEntryDescription:
"Introduce estos datos en el otro dispositivo.",
dataEntryInputDescription:
"Introduce los datos mostrados en el otro dispositivo.",
fromThisDeviceButton: "Enviar a otro dispositivo",
toThisDeviceButton: "Enviar a este dispositivo",
exportButton: "Exportar archivo",
importButton: "Importar archivo",
generalHeadline: "General",
connectionData: "Datos de Conexión",
settingsData: "Datos de Configuración",
chatsHeadline: "Chats",
transferChannelHeadline: "Canal de Transferencia",
transferKeyHeadline: "Clave de encriptación de transferencia",
sendButton: "Enviar",
sendAgainButton: "Enviar otra vez",
filesSentCount: (count) => `Archivos enviados: ${count}.`,
allFilesSent: "Hecho.",
filesReceivedCount: (count) => `Archivos recibidos: ${count}.`,
exportKey: "Clave de encriptación",
exportKeyConfirmation: "Confirmar clave",
downloadFileButton: "Descargar",
importFileButton: "Importar",
decryptImportButton: "Descifrar",
incorrectPassphraseError: "La clave no es correcta"
},
storage: {
noItemSelected: "Ningún elemento seleccionado",
notAFile: "(no es un archivo)",
contentEmpty: "(vacío)",
path: "Ruta",
content: "Contenido",
deleteItem: "Eliminar elemento",
removeJunkButton: "Eliminar archivos basura",
},
chatPage: {
closeChatAudioLabe: "cerrar chat",
chatSettingsAudioLabel: "configuración del chat",
pages: {
settings: "Configuración",
messages: "Mensajes",
tasks: "Tareas",
calendar: "Calendario",
},
settings: {
settingsHeadline: "Configuración",
primaryChannelLabel: "Canal principal",
setPrimaryChannelButtonAudioLabel: "establecer canal principal",
namespaceLabel: "Espacio de nombres",
namespacePlaceholder: "Sin espacio de nombres",
setNamespaceButtonAudioLabel: "establecer espacio de nombres",
newSecondaryChannelPlaceholder: "Añadir canal secundario",
newSecondaryChannelAudioLabel:
"nombre del nuevo canal secundario",
addSecondaryChannelButtonAudioLabel: "añadir canal secundario",
settings: {
settingsHeadline: "Configuración",
encryptionKeyLabel: "Clave de encriptación",
setEncryptionKeyButtonAudioLabel:
"establecer clave de encriptación",
showEncryptionKey: "Mostrar clave de encriptación",
primaryChannelLabel: "Canal principal",
setPrimaryChannelButtonAudioLabel: "establecer canal principal",
deleteChatButton: "Eliminar todo el chat",
},
namespaceLabel: "Espacio de nombres",
namespacePlaceholder: "Sin espacio de nombres",
setNamespaceButtonAudioLabel: "establecer espacio de nombres",
message: {
messagesHeadline: "Mensajes",
newSecondaryChannelPlaceholder: "Añadir canal secundario",
newSecondaryChannelAudioLabel:
"nombre del nuevo canal secundario",
addSecondaryChannelButtonAudioLabel: "añadir canal secundario",
messageFilterHeadline: "Filtrar mensajes",
messageFilterReactionsHadline: "Reacciones",
messageFilterAllReactionsButton: "Mostrar todas",
encryptionKeyLabel: "Clave de encriptación",
setEncryptionKeyButtonAudioLabel:
"establecer clave de encriptación",
showEncryptionKey: "Mostrar clave de encriptación",
composerInputPlaceholder: "Escribe un mensaje...",
sendMessageButtonAudioLabel: "enviar mensaje",
filterMessagesButtonAudioLabel: "filtrar mensajes",
deleteChatButton: "Eliminar todo el chat",
},
showMessageInfoButtonAudioLabel:
"mostrar información del mensaje",
messageInfoHeadline: "Información del Mensaje",
cancelReplyAudioLabel: "abortar la respuesta",
message: {
messagesHeadline: "Mensajes",
sentBy: "Enviado por",
timeSent: "Hora de envío",
channel: "Canal",
messageContent: "Contenido del mensaje",
messageFilterHeadline: "Filtrar mensajes",
messageFilterReactionsHadline: "Reacciones",
messageFilterAllReactionsButton: "Mostrar todas",
copyMessageButton: "Copiar mensaje",
resendMessageButton: "Reenviar mensaje",
decryptMessageButton: "Desencriptar mensaje",
replyToMessageButton: "Responder al mensaje",
deleteMessageButton: "Eliminar mensaje",
composerInputPlaceholder: "Escribe un mensaje...",
sendMessageButtonAudioLabel: "enviar mensaje",
filterMessagesButtonAudioLabel: "filtrar mensajes",
//
showMessageInfoButtonAudioLabel:
"mostrar información del mensaje",
messageInfoHeadline: "Información del Mensaje",
cancelReplyAudioLabel: "abortar la respuesta",
thumbsUpReaction: "Reacción: pulgar hacia arriba",
checkReaction: "Reacción: marca de verificación",
stopReaction: "Reacción: signo de parada",
attentionReaction: "Reaccion: signo de atención",
doubleAttentionReaction: "Reaccion: signo de atención doble",
questionReaction: "Reaccion: signo de interrogación",
},
sentBy: "Enviado por",
timeSent: "Hora de envío",
channel: "Canal",
messageContent: "Contenido del mensaje",
task: {
newBoardNamePlaceholder: "Crear un tablero",
createBoardButtonAudioLabel: "crear tablero",
copyMessageButton: "Copiar mensaje",
resendMessageButton: "Reenviar mensaje",
decryptMessageButton: "Desencriptar mensaje",
replyToMessageButton: "Responder al mensaje",
deleteMessageButton: "Eliminar mensaje",
noBoardSelected: "Ningún tablero seleccionado",
boardNotFound: "Tablero no encontrado",
//
closeBoardButtonAudioLabel: "cerrar tablero",
toggleBoardButtonAudioLabel:
"mostrar o ocultar lista de tableros",
showBoardSettingsButtonAudioLabel:
"mostrar configuración del tablero",
thumbsUpReaction: "Reacción: pulgar hacia arriba",
checkReaction: "Reacción: marca de verificación",
stopReaction: "Reacción: signo de parada",
attentionReaction: "Reaccion: signo de atención",
doubleAttentionReaction: "Reaccion: signo de atención doble",
questionReaction: "Reaccion: signo de interrogación",
},
listViewButtonAudioLabel: "vista de lista",
kanbanViewButtonAudioLabel: "vista kanban",
statusViewButtonAudioLabel: "vista de cuadrícula de estado",
task: {
newBoardNamePlaceholder: "Crear un tablero",
createBoardButtonAudioLabel: "crear tablero",
filterTasksButtonAudioLabel: "filtrar tareas",
createTaskButtonAudioLabel: "crear nueva tarea",
noBoardSelected: "Ningún tablero seleccionado",
boardNotFound: "Tablero no encontrado",
boardSettingsHeadline: "Configuración del Tablero",
boardNameInputLabel: "Nombre del tablero",
deleteBoardButton: "Eliminar tablero y todas las tareas",
closeBoardButtonAudioLabel: "cerrar tablero",
toggleBoardButtonAudioLabel:
"mostrar o ocultar lista de tableros",
showBoardSettingsButtonAudioLabel:
"mostrar configuración del tablero",
taskSettingsHeadline: "Editar Tarea",
listViewButtonAudioLabel: "vista de lista",
kanbanViewButtonAudioLabel: "vista kanban",
statusViewButtonAudioLabel: "vista de cuadrícula de estado",
taskNameLabel: "Título",
taskBoardLabel: "Tablero",
filterTasksButtonAudioLabel: "filtrar tareas",
createTaskButtonAudioLabel: "crear nueva tarea",
taskCategoryLabel: "Categoría",
taskStatusLabel: "Estado",
taskPriorityLabel: "Prioridad",
boardSettingsHeadline: "Configuración del Tablero",
boardNameInputLabel: "Nombre del tablero",
deleteBoardButton: "Eliminar tablero y todas las tareas",
taskDescriptionLabel: "Descripción",
taskSettingsHeadline: "Editar Tarea",
taskDateLabel: "Fecha",
taskTimeLabel: "Hora",
taskNameLabel: "Título",
taskBoardLabel: "Tablero",
deleteTaskButton: "Eliminar tarea",
taskCategoryLabel: "Categoría",
taskStatusLabel: "Estado",
taskPriorityLabel: "Prioridad",
filterTasksHeadline: "Filtrar Tareas",
taskDescriptionLabel: "Descripción",
renameCategoryInputPlaceholder: "Renombrar categoría",
renameStatusInputPlaceholder: "Renombrar estado",
},
taskDateLabel: "Fecha",
taskTimeLabel: "Hora",
calendar: {
eventsBoard: "Eventos",
deleteTaskButton: "Eliminar tarea",
///
filterTasksHeadline: "Filtrar Tareas",
todayButtonAudioLabel: "ir a hoy",
renameCategoryInputPlaceholder: "Renombrar categoría",
renameStatusInputPlaceholder: "Renombrar estado",
},
previousMonthButtonAudioLabel: "mes anterior",
nextMonthButtonAudioLabel: "mes siguiente",
calendar: {
eventsBoard: "Eventos",
yearInputAudioLabel: "año",
monthInputAudioLabel: "mes",
///
yearInputPlaceholder: "2000",
monthInputPlaceholder: "01",
todayButtonAudioLabel: "ir a hoy",
searchEventsHeadline: "Buscar Eventos",
previousMonthButtonAudioLabel: "mes anterior",
nextMonthButtonAudioLabel: "mes siguiente",
yearInputAudioLabel: "año",
monthInputAudioLabel: "mes",
yearInputPlaceholder: "2000",
monthInputPlaceholder: "01",
searchEventsHeadline: "Buscar Eventos",
events: "Eventos",
noEvents: "No hay eventos",
},
},
events: "Eventos",
noEvents: "No hay eventos",
},
},
},
};
+3 -3
View File
@@ -7,9 +7,9 @@ class Tracker<T> {
class TrackerMap<T> {
trackers = new Map<string, Tracker<T>>();
private register = (key: string): Tracker<T> => {
private register = (key: string): Tracker<T>=> {
if (this.trackers.has(key)) {
return this.trackers.get(key);
return this.trackers.get(key)!;
}
const tracker = new Tracker<T>();
this.trackers.set(key, tracker);
@@ -19,7 +19,7 @@ class TrackerMap<T> {
setState = (
key: string,
stateBuilder: () => React.State<T>,
): React.State<T | undefined> | undefined => {
): React.State<T> | undefined => {
const tracker: Tracker<T> = this.register(key);
if (tracker.state != undefined) {
+3 -3
View File
@@ -11,9 +11,9 @@ import {
export default class ChatMessageViewModel {
// data
chatMessage: ChatMessage;
channel: string;
sender: string;
dateSent: string;
channel: string = "";
sender: string = "";
dateSent: string = "";
body: React.State<string> = new React.State("");
inlineReply: ChatMessageViewModel | undefined = undefined;
status: React.State<ChatMessageStatuses | any> = new React.State<any>(
+2 -2
View File
@@ -143,14 +143,14 @@ export default class ChatViewModel extends ContextHost<ChatPageTypes> {
// init
constructor(
public readonly coreViewModel: CoreViewModel,
readonly coreViewModel: CoreViewModel,
public readonly chatModel: ChatModel,
public readonly settingsViewModel: SettingsViewModel,
public readonly notificationViewModel: NotificationViewModel,
public readonly connectionViewModel: ConnectionViewModel,
public readonly chatListViewModel: ChatListViewModel,
) {
super("chat");
super("chat", coreViewModel);
// page viewModels
this.calendarViewModel = new CalendarPageViewModel(
Binary file not shown.
+12 -5
View File
@@ -9,7 +9,7 @@ import ConnectionModel from "../../Model/Global/connectionModel";
import ChatListModel from "../../Model/Chat/chatListModel";
export default class CoreViewModel {
readonly BUILD = "Build 26.09.06.A";
readonly BUILD = "Build 26.09.09.A";
translations: Translations;
@@ -40,7 +40,8 @@ export default class CoreViewModel {
return;
while (this.contexts.length > 0) {
const currentContext: Context = this.context;
const currentContext: Context|undefined= this.context;
if (!currentContext) return;
currentContext.handleContextClose(fromHistoryEvent);
this.contextStack.delete(currentContext.contextId);
if (currentContext.contextId == contextId) break;
@@ -53,7 +54,7 @@ export default class CoreViewModel {
const contexts: Context[] = this.contexts;
while (contexts.length > 0) {
const currentContext: Context | undefined = contexts.pop();
if (!currentContext) contexts;
if (!currentContext) return;
const isHandled: boolean = currentContext.handleKeystroke(e);
if (isHandled == true) break;
}
@@ -102,6 +103,7 @@ export default class CoreViewModel {
document.body.addEventListener("keydown", this.handleKeyDown);
window.onpopstate = () => {
if (!this.context) return;
this.closeContext(this.context.contextId, true);
};
@@ -142,7 +144,6 @@ export class Context {
}
export class ContextHost<T> extends Context {
coreViewModel: CoreViewModel;
contexts = new Map<T, Context>();
currentContext = new React.State<Context | undefined>(undefined);
@@ -169,8 +170,10 @@ export class ContextHost<T> extends Context {
updateContexts = (): void => {
if (this.isOpen == false) return;
const selection = this.contextSelection;
if (!selection) return;
const selectedContext: Context | undefined = this.contexts.get(
this.contextSelection,
selection
);
if (!selectedContext) return;
if (selectedContext != this.currentContext.value) {
@@ -180,4 +183,8 @@ export class ContextHost<T> extends Context {
this.coreViewModel.context = selectedContext;
this.currentContext.value = selectedContext;
};
constructor(contextDebugDescription: string, public coreViewModel: CoreViewModel) {
super(contextDebugDescription);
}
}
@@ -54,7 +54,7 @@ export default class FileTransferViewModel extends Context {
exportKey: React.State<string> = new React.State("");
exportKeyConfirmation: React.State<string> = new React.State("");
importedFile: React.State<File | undefined> = new React.State(undefined);
importedFile: React.State<File | undefined> = new React.State<File | undefined>(undefined);
importedFileString: React.State<string> = new React.State("");
importKey: React.State<string> = new React.State("");
isImportKeyCorrect: React.State<boolean> = new React.State(true);
@@ -158,6 +158,7 @@ export default class FileTransferViewModel extends Context {
if (!input) return;
if (!(input instanceof HTMLInputElement)) return;
if (!input.files) return;
const file = input.files[0];
this.importedFile.value = file;
};
@@ -170,6 +171,7 @@ export default class FileTransferViewModel extends Context {
reader.readAsText(file, "utf8");
reader.onload = () => {
const result = reader.result;
if (!result) return;
this.importedFileString.value = result.toString();
this.showImportDecryptDataModal();
};
@@ -35,7 +35,7 @@ export default class NotificationViewModel {
};
openNotification = () => {
const notification: Notification = this.marquee.value;
const notification: Notification|undefined = this.marquee.value;
if (notification == undefined) return;
const chat = [
@@ -44,6 +44,7 @@ export default class NotificationViewModel {
(chat) =>
chat.chatModel.unwrappedPrimaryChannel == notification.chat,
);
if (!chat) return;
chat.open();
chat.openPage(ChatPageTypes.Messages);
};
@@ -55,7 +56,8 @@ export default class NotificationViewModel {
return this.stopLoop();
}
const notification: Notification = this.messagesInMarquee.shift();
const notification: Notification|undefined = this.messagesInMarquee.shift();
if (!notification) return;
this.seenMessageIds.delete(notification.messageId);
this.marquee.value = notification;
};
+3 -3
View File
@@ -9,14 +9,14 @@ export default class SettingsViewModel extends Context {
usernameInput: React.State<string> = new React.State("");
isShowingSettingsModal: React.State<boolean> = new React.State(false);
selectedModalPage: React.State<SettingsModalPages | undefined> =
new React.State(undefined);
new React.State<SettingsModalPages | undefined>(undefined);
requiresReload = new React.State<boolean>(false);
firstDayOfWeek: React.State<string> = new React.State("0");
language: React.State<Languages | string> = new React.State(
language: React.State<Languages | string> = new React.State<Languages | string>(
Languages.English,
);
theme: React.State<ThemeSettings | string> = new React.State(
theme: React.State<ThemeSettings | string> = new React.State<ThemeSettings | string>(
ThemeSettings.System,
);
+1 -1
View File
@@ -23,7 +23,7 @@ export default class StorageViewModel extends Context {
const path: string[] = StorageModel.stringToPathComponents(
this.selectedPath.value,
);
const content: string | undefined =
const content: string | null =
this.coreViewModel.storageModel.read(path);
return (
(content ?? this.coreViewModel.translations.storage.notAFile) ||
+1 -1
View File
@@ -68,7 +68,7 @@ export default class MessagePageViewModel extends Context {
);
};
setReply = (chatMessageViewModel: ChatMessageViewModel): void => {
setReply = (chatMessageViewModel: ChatMessageViewModel|undefined): void => {
this.replyingMessage.value = chatMessageViewModel;
this.setFocus();
};
+2 -2
View File
@@ -167,11 +167,11 @@ export default class TaskPageViewModel extends ContextHost<string> {
// init
constructor(
public readonly coreViewModel: CoreViewModel,
readonly coreViewModel: CoreViewModel,
public readonly chatViewModel: ChatViewModel,
public readonly boardsAndTasksModel: BoardsAndTasksModel,
) {
super("task-page");
super("task-page", coreViewModel);
this.loadData(); // needed for board options in calendar
-1
View File
@@ -16,7 +16,6 @@ import { SettingsModal } from "./View/Modals/settingsModal";
import { DataTransferModalWrapper } from "./View/Modals/dataTransferModal";
import { ConnectionModal } from "./View/Modals/connectionModal";
import v1Upgrader from "./Upgrader/v1";
import * as Utility from "./Model/Utility/utility";
import StorageModel from "./Model/Global/storageModel";
import SettingsModel from "./Model/Global/settingsModel";
import FileTransferModel from "./Model/Global/fileTransferModel";
+2
View File
@@ -0,0 +1,2 @@
declare module "*.css" {
}
+4 -2
View File
@@ -3,8 +3,10 @@
"noImplicitAny": false,
"jsx": "react",
"jsxFactory": "React.createElement",
"moduleResolution": "node",
"module": "nodenext",
"moduleResolution": "nodenext",
"esModuleInterop": true,
"target": "es2020"
}
},
"include":["./**/*"]
}