From 787b9f5a667a966a383de60dab201448cc4164e0 Mon Sep 17 00:00:00 2001 From: Micah Alcorn Date: Mon, 27 Aug 2018 09:31:18 -0700 Subject: [PATCH] Prevent mutation of array --- src/components/conversation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/conversation.js b/src/components/conversation.js index 04a88227afea..0e3b4ac476b1 100644 --- a/src/components/conversation.js +++ b/src/components/conversation.js @@ -103,7 +103,7 @@ class Conversation extends Component { async loadListing() { const { messages } = this.props // find the most recent listing context or set empty value - const { listingAddress } = messages.reverse().find(m => m.listingAddress) || {} + const { listingAddress } = [...messages].reverse().find(m => m.listingAddress) || {} // get the listing const listing = listingAddress ? (await origin.listings.get(listingAddress)) : {} // if listing does not match state, store and check for a purchase