Skip to content

Commit

Permalink
fix[PBE-4930]: Fix checklist item on Team Collaboration demo (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
vandreleal authored Jun 26, 2024
1 parent d6dfe10 commit b2a0736
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion team-ts/src/ChecklistTasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const notifyParent = (parent: string) => (message: any) => {
};

const YOUTUBE_LINK = 'https://youtu.be/Ujvy-DEA-UM';
const YOUTUBE_LINK_RE = /^(http(s)?:\/\/)?(youtu.be\/Ujvy-DEA-UM\/?)$/;

// We have to keep this task list up-to-date with the website's checklist
const [REACT_TO_MESSAGE, RUN_GIPHY, SEND_YOUTUBE, DRAG_DROP, START_THREAD, SEND_MESSAGE] = [
Expand Down Expand Up @@ -48,7 +49,8 @@ export const useChecklist = (props: ChecklistTaskProps): void => {
if (message?.attachments?.length) {
if (
message.attachments[0].type === 'video' &&
message.attachments[0].og_scrape_url === YOUTUBE_LINK
(message.attachments[0].og_scrape_url === YOUTUBE_LINK ||
YOUTUBE_LINK_RE.test(message.attachments[0].og_scrape_url as string))
) {
notify(SEND_YOUTUBE);
break;
Expand Down
4 changes: 3 additions & 1 deletion team/src/ChecklistTasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const notifyParent = (parent) => (message) => {
};

const YOUTUBE_LINK = 'https://youtu.be/Ujvy-DEA-UM';
const YOUTUBE_LINK_RE = /^(http(s)?:\/\/)?(youtu.be\/Ujvy-DEA-UM\/?)$/;

// We have to keep this task list up-to-date with the website's checklist
const [REACT_TO_MESSAGE, RUN_GIPHY, SEND_YOUTUBE, DRAG_DROP, START_THREAD, SEND_MESSAGE] = [
Expand Down Expand Up @@ -32,7 +33,8 @@ export const useChecklist = (chatClient, targetOrigin) => {
if (message.attachments.length) {
if (
message.attachments[0].type === 'video' &&
message.attachments[0].og_scrape_url === YOUTUBE_LINK
(message.attachments[0].og_scrape_url === YOUTUBE_LINK ||
YOUTUBE_LINK_RE.test(message.attachments[0].og_scrape_url))
) {
notify(SEND_YOUTUBE);
break;
Expand Down

0 comments on commit b2a0736

Please sign in to comment.