From 5a0a2c2220afb75b331231d9d8bcc28b9cb04a73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Espino=20Garc=C3=ADa?= Date: Sat, 12 Mar 2022 20:41:07 +0100 Subject: [PATCH] Fix message not being added to the database when it fails (#6043) --- app/actions/remote/post.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/actions/remote/post.ts b/app/actions/remote/post.ts index 5291850a4..0ac390af0 100644 --- a/app/actions/remote/post.ts +++ b/app/actions/remote/post.ts @@ -53,7 +53,7 @@ export const createPost = async (serverUrl: string, post: Partial, files: return {error}; } - const currentUserId = queryCurrentUserId(operator.database); + const currentUserId = await queryCurrentUserId(operator.database); const timestamp = Date.now(); const pendingPostId = post.pending_post_id || `${currentUserId}:${timestamp}`; @@ -68,6 +68,7 @@ export const createPost = async (serverUrl: string, post: Partial, files: pending_post_id: pendingPostId, create_at: timestamp, update_at: timestamp, + delete_at: 0, } as Post; if (files.length) {