fix deletion back
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user