Skip to content

Commit

Permalink
fix(absence): Don't break when you are the absence or it's recursion
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Feb 6, 2025
1 parent 617f1f9 commit 5931ead
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/components/NewMessage/NewMessageAbsenceInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<script>
import ChevronUp from 'vue-material-design-icons/ChevronUp.vue'

import { getCurrentUser } from '@nextcloud/auth'
import { t } from '@nextcloud/l10n'
import moment from '@nextcloud/moment'

Expand Down Expand Up @@ -142,6 +143,16 @@ export default {
},

async openConversationWithReplacementUser() {
if (this.userAbsence.replacementUserId === getCurrentUser().uid) {
// Don't open a chat with one-self
return
}

if (this.userAbsence.replacementUserId === this.userAbsence.userId) {
// Don't recursively go to the current chat
return
}

this.$router.push({
name: 'root',
query: {
Expand Down

0 comments on commit 5931ead

Please sign in to comment.