diff --git a/index.html b/index.html index 8a2e8f1..d370a1f 100644 --- a/index.html +++ b/index.html @@ -155,8 +155,8 @@
-
-
+
+
@@ -466,6 +466,21 @@ isMobile() { return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); }, + selectedPeerChatItems() { + + // get all chat items related to the selected peer + if(this.selectedPeer){ + return this.chatItems.filter((chatItem) => { + const isFromSelectedPeer = chatItem.source_hash === this.selectedPeer.destination_hash; + const isToSelectedPeer = chatItem.destination_hash === this.selectedPeer.destination_hash; + return isFromSelectedPeer || isToSelectedPeer; + }); + } + + // no peer, so no chat items! + return []; + + } }, }).mount('#app');