cleanup path management

This commit is contained in:
marlon-erler
2024-07-25 16:44:08 +02:00
parent 1dc2da2514
commit c9d74972b8
10 changed files with 57 additions and 67 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
import * as React from "bloatless-react";
import ChatModel, { ChatMessage } from "../../Model/Chat/chatModel";
import StorageModel, { filePaths } from "../../Model/Global/storageModel";
import StorageModel, { StorageModelSubPath, filePaths } from "../../Model/Global/storageModel";
import ChatListViewModel from "./chatListViewModel";
import { Color } from "../../colors";
@@ -62,7 +62,7 @@ export default class ChatViewModel {
// load
loadPageSelection = (): void => {
const path: string[] = StorageModel.getPath(
"chat",
StorageModelSubPath.Chat,
filePaths.chat.lastUsedPage(this.chatModel.id)
);
const lastUsedPage: string | null = this.storageModel.read(path);
+2 -2
View File
@@ -51,7 +51,7 @@ export default class BoardViewModel {
};
getLastUsedBoardPath = (): string[] => {
return [...this.getBasePath(), BoardViewModelSubPaths.LastUsedView];
return [...this.getBasePath(), BoardViewModelSubPath.LastUsedView];
};
// settings
@@ -264,7 +264,7 @@ export default class BoardViewModel {
}
}
export enum BoardViewModelSubPaths {
export enum BoardViewModelSubPath {
LastUsedView = "last-used-view",
}
+2 -2
View File
@@ -29,7 +29,7 @@ export default class TaskPageViewModel {
};
getLastUsedBoardPath = (): string[] => {
return [...this.getBasePath(), TaskPageViewModelSubPaths.LastUsedBoard];
return [...this.getBasePath(), TaskPageViewModelSubPath.LastUsedBoard];
};
// state
@@ -162,6 +162,6 @@ export default class TaskPageViewModel {
}
}
export enum TaskPageViewModelSubPaths {
export enum TaskPageViewModelSubPath {
LastUsedBoard = "last-used-board",
}