sales-frontend-debug 0.0.48 → 0.0.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +6 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React8, { useEffect, useState, useMemo, useRef, useCallback } from 'react';
|
|
2
2
|
import { getCookie, setCookie, deleteCookie } from 'sales-frontend-utils/cookie';
|
|
3
|
-
import {
|
|
3
|
+
import { isClient, getEnvironmentFromHostname } from 'sales-frontend-utils';
|
|
4
4
|
import { useDebugStore } from 'sales-frontend-stores';
|
|
5
5
|
|
|
6
6
|
// src/debug-tool.tsx
|
|
@@ -1090,6 +1090,9 @@ var DebugTool = ({
|
|
|
1090
1090
|
);
|
|
1091
1091
|
};
|
|
1092
1092
|
function addRequestLog(config) {
|
|
1093
|
+
if (!isClient()) {
|
|
1094
|
+
return;
|
|
1095
|
+
}
|
|
1093
1096
|
const env = getEnvironmentFromHostname(location.hostname);
|
|
1094
1097
|
if (env !== "prd") {
|
|
1095
1098
|
const { addRequest, isHold, holdRequest } = useDebugStore.getState();
|
|
@@ -1112,6 +1115,9 @@ function addRequestLog(config) {
|
|
|
1112
1115
|
}
|
|
1113
1116
|
}
|
|
1114
1117
|
function addResponseLog(response) {
|
|
1118
|
+
if (!isClient()) {
|
|
1119
|
+
return;
|
|
1120
|
+
}
|
|
1115
1121
|
const env = getEnvironmentFromHostname(location.hostname);
|
|
1116
1122
|
if (env !== "prd") {
|
|
1117
1123
|
const { addResponse, isHold, holdResponse } = useDebugStore.getState();
|