fix deletion back

This commit is contained in:
grimhilt
2023-05-08 00:35:18 +02:00
parent b2b0949353
commit 53c79aebc4
5 changed files with 38 additions and 42 deletions

View File

@@ -30,17 +30,18 @@ export default class Message {
}
async useFlags(): Promise<Message> {
let flags;
if (!this._flags) {
if (this.messageId) {
await getFlagsOnId(this.messageId);
return this;
flags = await getFlagsOnId(this.messageId);
} else if (this.uid) {
await getFlagsOnUid(this.uid);
return this;
flags = await getFlagsOnUid(this.uid);
} else {
throw "Neither message id or uid are set, please do so before attempting to load flags";
}
this._flags = flags;
}
return this;
}
async useMailbox(mailboxId: number, user?: string): Promise<Message> {
@@ -62,6 +63,8 @@ export default class Message {
}
get flags(): string[] {
console.log("called");
console.log(this._flags);
if (!this._flags) {
throw "Flags not loaded, call useFlags before calling functions related to flags";
} else {