Skip to content

Commit

Permalink
simplified check
Browse files Browse the repository at this point in the history
  • Loading branch information
NeloBlivion authored Jan 29, 2024
1 parent 4f87194 commit 6ecf948
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/views/AddChannelRequest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ export default {
return (
(cid
&& !cid[0].includes("/c/")
&& (cid[1].length > 12 || cid[0].endsWith('@'))
&& (cid[1].length > 12 || cid[0].includes('@'))
&& cid[0].startsWith("ht"))
|| this.$t("channelRequest.ChannelURLErrorFeedback")
);
Expand All @@ -270,7 +270,7 @@ export default {
const regex = /(?:https?:\/\/)(?:www\.)?youtu(?:be\.com\/)(?:channel\/|@)([\w\-_]*)/gi;
const matches = [...this.link.matchAll(regex)];
let id = matches?.[0]?.[1];
handle = matches[0][0].endsWith('@')
handle = this.link.includes('@')
id = handle ? '@' + id : id;
try {
Expand Down

0 comments on commit 6ecf948

Please sign in to comment.