integrate taskViewModel

This commit is contained in:
marlon-erler
2024-07-24 01:19:44 +02:00
parent 5a34a54273
commit bd880dfa06
8 changed files with 195 additions and 71 deletions
+5 -4
View File
@@ -3,13 +3,14 @@ import * as React from "bloatless-react";
import ChatListModel from "../../Model/Chat/chatListModel";
import ChatModel from "../../Model/Chat/chatModel";
import ChatViewModel from "./chatViewModel";
import FileModel from "../../Model/Files/fileModel";
import { IndexManager } from "../../Model/Utility/utility";
import SettingsViewModel from "../Global/settingsViewModel";
import StorageModel from "../../Model/Global/storageModel";
export default class ChatListViewModel {
chatListModel: ChatListModel;
storageModel: StorageModel;
chatListModel: ChatListModel;
settingsViewModel: SettingsViewModel;
// data
@@ -55,8 +56,8 @@ export default class ChatListViewModel {
createChatViewModel = (chatModel: ChatModel): ChatViewModel => {
return new ChatViewModel(
chatModel,
this.storageModel,
chatModel,
this.settingsViewModel,
this
);
@@ -90,12 +91,12 @@ export default class ChatListViewModel {
// init
constructor(
chatListModel: ChatListModel,
storageModel: StorageModel,
chatListModel: ChatListModel,
settingsViewModel: SettingsViewModel
) {
this.chatListModel = chatListModel;
this.storageModel = storageModel;
this.chatListModel = chatListModel;
this.settingsViewModel = settingsViewModel;
this.loadChats();
+3 -3
View File
@@ -77,21 +77,21 @@ export default class ChatViewModel {
// init
constructor(
chatModel: ChatModel,
storageModel: StorageModel,
chatModel: ChatModel,
settingsViewModel: SettingsViewModel,
chatListViewModel: ChatListViewModel
) {
// models
this.chatModel = chatModel;
this.storageModel = storageModel;
this.chatModel = chatModel;
this.settingsViewModel = settingsViewModel;
this.chatListViewModel = chatListViewModel;
// page viewModels
this.taskPageViewModel = new TaskPageViewModel(
this.chatModel.fileModel.taskModel,
this.storageModel,
this.chatModel.fileModel.taskModel,
this
);
this.messagePageViewModel = new MessagePageViewModel(this);