add list to BoardPage

This commit is contained in:
marlon-erler
2024-07-23 00:05:48 +02:00
parent 48b4a0e941
commit 169f1fea2f
6 changed files with 89 additions and 20 deletions
+17 -3
View File
@@ -1,8 +1,6 @@
import * as React from "bloatless-react";
import TaskModel, {
BoardInfoFileContent,
} from "../../Model/Files/taskModel";
import TaskModel, { BoardInfoFileContent } from "../../Model/Files/taskModel";
import StorageModel from "../../Model/Global/storageModel";
@@ -26,6 +24,22 @@ export default class TaskPageViewModel {
this.taskModel.createBoard(this.newBoardNameInput.value);
this.newBoardNameInput.value = "";
this.loadData();
};
// load
loadData = (): void => {
this.boards.clear();
const boardIds: string[] = this.taskModel.listBoardIds();
for (const boardId of boardIds) {
const boardInfo: BoardInfoFileContent | null =
this.taskModel.getBoardInfo(boardId);
if (boardInfo == null) continue;
this.boards.add(boardInfo);
}
};
// init