Skip to content

Conversation

@igorroc
Copy link

@igorroc igorroc commented Jun 20, 2024

Fixes and Improvements to useHasNewDeploy Hook

Description

This PR addresses and fixes several issues in the useHasNewDeploy hook. The following changes have been made to improve the functionality and reliability of the hook:

Changes

1. Corrected HTTP Status Code Check

  • Original line: if (response.status > 400)
  • Updated line: if (response.status >= 400)

This change ensures that any response with a status code of 400 or higher will be properly handled as an error.

2. Improved Debug Logging

  • Original line: console.log(...["[Deploy notifications] ", message]);
  • Updated line: console.log("[Deploy notifications] ", message);

The spread operator was unnecessary in this context and has been removed for clearer and more efficient logging.

3. Corrected Interval Logic

  • Original line: let loopInterval = interval < 3_000 ? interval : 3_000;
  • Updated line: let loopInterval = interval > 3_000 ? interval : 3_000;

This update ensures that the interval logic correctly enforces a minimum interval of 3,000 milliseconds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant