Skip to content

Commit

Permalink
fix: show join channel in add-channel if external, fixes #136
Browse files Browse the repository at this point in the history
  • Loading branch information
valeriansaliou committed Aug 25, 2024
1 parent c754a08 commit a299065
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/modals/sidebar/AddChannel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ export default {
return this.hasExistence === true && this.existence.exists;
},

isExternal(): boolean {
return this.jid.includes("@");
},

channelSuggestions(): Array<FormFieldSuggestSuggestion> {
// Do not return any suggestion if private mode
if (this.private === true) {
Expand All @@ -182,8 +186,8 @@ export default {
return "Create Private Channel";
}

// Join existing channel?
if (this.doesExist === true) {
// Join existing or external channel?
if (this.doesExist === true || this.isExternal === true) {
return "Join Channel";
}

Expand Down Expand Up @@ -246,7 +250,7 @@ export default {

// Check if channel already exists? (only if not a JID-like value, and \
// if channel is public)
if (address && address.includes("@") === false && this.private !== true) {
if (address && this.isExternal === false && this.private !== true) {
// Alias address to a channel name (since it is not JID-like)
const name = address.toLowerCase();

Expand Down

0 comments on commit a299065

Please sign in to comment.