From 7bea097c9042a8f87d22f689cfe5cbcc6e857957 Mon Sep 17 00:00:00 2001 From: Mattermost Build Date: Thu, 6 Jan 2022 15:53:12 +0200 Subject: [PATCH] Fixes custom status update (#5881) (#5895) (cherry picked from commit 16d4231ccd83b9d2e98d1fefe41885ac281b74ae) Co-authored-by: Shaz Amjad --- app/actions/views/custom_status.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/actions/views/custom_status.ts b/app/actions/views/custom_status.ts index 97f12d845..b7c3e4e67 100644 --- a/app/actions/views/custom_status.ts +++ b/app/actions/views/custom_status.ts @@ -19,6 +19,11 @@ export function setCustomStatus(customStatus: UserCustomStatus): ActionFunc { user.props.customStatus = JSON.stringify(customStatus); dispatch({type: UserTypes.RECEIVED_ME, data: user}); + // Server does not like empty 'expires_at' string. + if (!customStatus.expires_at) { + delete customStatus.expires_at; + } + try { await Client4.updateCustomStatus(customStatus); } catch (error) {