Fix “Cannot destructure property expiration of 'undefined’” on reminders UI

This commit is contained in:
Ben Gotow 2020-04-16 01:34:06 -05:00
parent 66b6e14bb9
commit 2a92394aca

View file

@ -34,12 +34,12 @@ class SendRemindersThreadTimestamp extends Component<SendRemindersThreadTimestam
return <Fallback {...this.props} />;
}
const { expiration } = this.props.thread.metadataForPluginId(PLUGIN_ID);
if (!expiration) {
const metadata = this.props.thread.metadataForPluginId(PLUGIN_ID);
if (!metadata || !metadata.expiration) {
return <Fallback {...this.props} />;
}
const mExpiration = moment(expiration);
const mExpiration = moment(metadata.expiration);
return (
<span