sync flags on server start

This commit is contained in:
grimhilt
2023-04-17 13:08:54 +02:00
parent 0f063deff9
commit cd996d851a
3 changed files with 64 additions and 19 deletions

View File

@@ -12,7 +12,8 @@ export default class updateMessage {
}
async updateFlags() {
const messageId = (await getMessageIdOnUid(this.uid))[0].message_id;
const messageId = (await getMessageIdOnUid(this.uid))[0]?.message_id;
if (!messageId) return;
const currentFlags = await getFlags(this.uid);
const flagsToAdd = this.flags.filter((flag) => !currentFlags.find((f) => flag == f.flag_name));