Skip to content

Issue: Fix Undefined goToRoom Function in VideoConferenceBlock Component #1024

@divysaxena24

Description

@divysaxena24

Location

File: packages/fuselage-ui-kit/src/blocks/VideoConferenceBlock/VideoConferenceBlock.tsx
Lines: 67–70


Problem

The openDiscussion function is attempting to call goToRoom(data.discussionRid) but the function goToRoom is not defined or imported in this component.
This causes a runtime ReferenceError when the "Open Discussion" button is clicked during a video conference.

Current Code:

const openDiscussion = () => {
  if (data.discussionRid) {
    goToRoom(data.discussionRid); 
  }
};


// Proposed Solution
     //  Import the correct navigation hook
    import { useGoToRoom } from '@rocket.chat/ui-contexts';
    
    const VideoConferenceBlock = ({ data }) => {
      const goToRoom = useGoToRoom();
    
      const openDiscussion = () => {
        if (data.discussionRid) {
          goToRoom(data.discussionRid); =
        }
      };
    
      return (
        // Component JSX here
      );
    };
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions