mirror of
https://github.com/liamcottle/reticulum-meshchat.git
synced 2026-10-26 19:01:43 -04:00
auto update router url when navigating through conversations
This commit is contained in:
parent
580c907138
commit
7d1681fbf1
1 changed files with 23 additions and 1 deletions
|
|
@ -15,7 +15,7 @@
|
|||
:my-lxmf-address-hash="config?.lxmf_address_hash"
|
||||
:selected-peer="selectedPeer"
|
||||
:conversations="conversations"
|
||||
@close="selectedPeer = null"
|
||||
@close="onCloseConversationViewer"
|
||||
@reload-conversations="getConversations"/>
|
||||
|
||||
</div>
|
||||
|
|
@ -211,7 +211,18 @@ export default {
|
|||
this.peers[announce.destination_hash] = announce;
|
||||
},
|
||||
onPeerClick: function(peer) {
|
||||
|
||||
// update selected peer
|
||||
this.selectedPeer = peer;
|
||||
|
||||
// update current route
|
||||
this.$router.replace({
|
||||
name: "messages",
|
||||
params: {
|
||||
destinationHash: peer.destination_hash,
|
||||
},
|
||||
});
|
||||
|
||||
},
|
||||
onConversationClick: function(conversation) {
|
||||
|
||||
|
|
@ -222,6 +233,17 @@ export default {
|
|||
this.$refs["conversation-viewer"].markConversationAsRead(conversation);
|
||||
|
||||
},
|
||||
onCloseConversationViewer: function() {
|
||||
|
||||
// clear selected peer
|
||||
this.selectedPeer = null;
|
||||
|
||||
// update current route
|
||||
this.$router.replace({
|
||||
name: "messages",
|
||||
});
|
||||
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
conversations() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue