clean file content handling
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -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> = {
|
||||||
|
|||||||
@@ -6,5 +6,5 @@ export enum CommonKeys {
|
|||||||
CloseOrCancel = "backspace",
|
CloseOrCancel = "backspace",
|
||||||
Apply = "enter",
|
Apply = "enter",
|
||||||
Settings = ",",
|
Settings = ",",
|
||||||
Create = ";",
|
Create = "a",
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -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);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user