EmbeddedChat icon indicating copy to clipboard operation
EmbeddedChat copied to clipboard

fix/#132(task-9) - Refactor-useEffects

Open umangutkarsh opened this issue 2 years ago • 0 comments

Refactored useEffects in src/index.js

Acceptance Criteria fulfillment

  • [X] Task 9 - Refactor useEffects

Fixes #132

Description

In this refactoring:

  1. The first useEffect block is kept as is since it doesn't require changes.

  2. The second useEffect block is refactored to create a separate function handleLogoutAndReInstantiate to handle the logic of logging out and reinstantiating the RCInstance. This function is called conditionally based on the user's login status.

  3. The third useEffect block is refactored to extract the logic into a function named handleAuthChange, which is called when the authentication status changes.

umangutkarsh avatar Oct 15 '23 11:10 umangutkarsh