cleanup path management
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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",
|
||||
}
|
||||
|
||||
|
||||
@@ -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",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user