@@ -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');