fix bugs with message hiding
This commit is contained in:
@@ -95,6 +95,10 @@ export default class ChatModel {
|
||||
return [...this.getReactionDirPath(), id];
|
||||
};
|
||||
|
||||
readonly getPreviousFilterPath = (): string[] => {
|
||||
return [StorageModelSubPaths.Chat, ...filePaths.chat.previousFilter(this.id)];
|
||||
}
|
||||
|
||||
// handlers
|
||||
readonly handleMessage = (body: string): void => {
|
||||
const chatMessage: ChatMessage | null = parseValidObject(
|
||||
@@ -265,6 +269,14 @@ export default class ChatModel {
|
||||
this.storageModel.write(this.getColorPath(), this.color);
|
||||
};
|
||||
|
||||
readonly storeFilter = (filter: string): void => {
|
||||
this.storageModel.write(this.getPreviousFilterPath(), filter);
|
||||
}
|
||||
|
||||
readonly getFilter = (): string => {
|
||||
return this.storageModel.read(this.getPreviousFilterPath());
|
||||
}
|
||||
|
||||
readonly delete = () => {
|
||||
// untrack
|
||||
this.chatListModel.untrackChat(this);
|
||||
@@ -541,4 +553,4 @@ export const ChatMessageReactionReference: ChatMessageReaction = {
|
||||
content: "",
|
||||
|
||||
isDeleting: false,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -200,6 +200,7 @@ export default class FileModel {
|
||||
export enum FileModelSubPath {
|
||||
Data = "data",
|
||||
Model = "model",
|
||||
Chat = "chat",
|
||||
ModelView = "view",
|
||||
ModelTask = "tasks",
|
||||
ModelCalendar = "calendar",
|
||||
|
||||
@@ -254,6 +254,7 @@ export const filePaths = {
|
||||
...filePaths.chat.chatBase(id),
|
||||
"reactions",
|
||||
],
|
||||
previousFilter: (id: string) => [...filePaths.chat.chatBase(id), "previous-filter"],
|
||||
lastUsedPage: (id: string) => [
|
||||
...filePaths.chat.chatBase(id),
|
||||
"last-used-page",
|
||||
|
||||
Reference in New Issue
Block a user