Skip to content

Commit a78610a

Browse files
authored
Merge pull request #1186 from mayuran-deriv/mayuran/remove-console
Mayuran/ GRWT-6790/error console log
2 parents 2df81cf + 1c21ff5 commit a78610a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/javascript/app/pages/trade/initialization-manager.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,15 @@ const InitializationManager = (() => {
6969

7070
resolve(result);
7171
} catch (error) {
72-
// eslint-disable-next-line no-console
73-
console.error(`Attempt ${attempts}/${maxAttempts} failed for ${stepId}:`, error);
72+
73+
// Only log error if WebSocket is connected
74+
const socket = BinarySocket.get();
75+
const is_connected = socket && socket.readyState === 1;
76+
77+
if (is_connected) {
78+
// eslint-disable-next-line no-console
79+
console.error(`Attempt ${attempts}/${maxAttempts} failed for ${stepId}:`, error);
80+
}
7481

7582
if (attempts < maxAttempts) {
7683
// Retry after delay

0 commit comments

Comments
 (0)