clean file content handling

This commit is contained in:
marlon-erler
2026-09-22 20:11:40 +02:00
parent 959bee2c06
commit 3a2569b24e
6 changed files with 90 additions and 80 deletions
Binary file not shown.
Binary file not shown.
+8 -1
View File
@@ -70,8 +70,15 @@ export default class FileModel {
const didStore: boolean = this.storeFileContent(fileContent); const didStore: boolean = this.storeFileContent(fileContent);
if (didStore == false) return; if (didStore == false) return;
switch (fileContent.type) {
case "board-info":
case "task":
this.boardsAndTasksModel.handleFileContent(fileContent); this.boardsAndTasksModel.handleFileContent(fileContent);
break;
case "reaction":
this.chatModel.handleReaction(fileContent); this.chatModel.handleReaction(fileContent);
break;
}
}; };
// methods // methods
@@ -206,7 +213,7 @@ export interface FileContent<T extends string>
readonly creationDate: string; readonly creationDate: string;
readonly type: T; readonly type: T;
} }
// references // references
export const FileContentReference: FileContent<string> = { export const FileContentReference: FileContent<string> = {
+1 -1
View File
@@ -6,5 +6,5 @@ export enum CommonKeys {
CloseOrCancel = "backspace", CloseOrCancel = "backspace",
Apply = "enter", Apply = "enter",
Settings = ",", Settings = ",",
Create = ";", Create = "a",
} }
+2
View File
@@ -49,7 +49,9 @@ export default class CoreViewModel {
}; };
handleKeyDown = (e: KeyboardEvent): void => { handleKeyDown = (e: KeyboardEvent): void => {
if (!(e instanceof KeyboardEvent)) return console.trace("NOT A KEY EVENT");
if (CoreViewModel.checkIsKeystroke(e) == false) return; if (CoreViewModel.checkIsKeystroke(e) == false) return;
console.log(e.key);
e.preventDefault(); e.preventDefault();
const contexts: Context[] = this.contexts; const contexts: Context[] = this.contexts;
while (contexts.length > 0) { while (contexts.length > 0) {
+1
View File
@@ -154,6 +154,7 @@ export default class BoardViewModel extends TaskContainingPageViewModel {
this, this,
taskFileContent, taskFileContent,
); );
console.log("STILL HERE", taskFileContent.fileId);
this.taskViewModels.set(taskFileContent.fileId, taskViewModel); this.taskViewModels.set(taskFileContent.fileId, taskViewModel);
}; };