gomtm 0.0.294 → 0.0.295
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.
|
@@ -40,7 +40,7 @@ import { createJSONStorage, persist } from "zustand/middleware";
|
|
|
40
40
|
import { createStore } from "zustand/vanilla";
|
|
41
41
|
import { GoMtmDebug } from "../components/devtools/GoMtmDebug";
|
|
42
42
|
import { TransportProvider } from "../connectquery";
|
|
43
|
-
import { CookieConfigState, HOTKEY_Debug } from "../consts";
|
|
43
|
+
import { CookieConfigState, HOTKEY_Debug, MTM_API_PREFIX } from "../consts";
|
|
44
44
|
import { anypbTypeReg } from "../messageTypeRegistry";
|
|
45
45
|
import { gomtmFetcher } from "../mtmFetcher";
|
|
46
46
|
import { MtReactQueryProvider } from "../providers/ReactQueryProvider";
|
|
@@ -88,13 +88,19 @@ const GoMtmAppProvider = (props) => {
|
|
|
88
88
|
if (!storeRef.current) {
|
|
89
89
|
storeRef.current = createGomtmAppStore(props);
|
|
90
90
|
}
|
|
91
|
-
return /* @__PURE__ */
|
|
92
|
-
/* @__PURE__ */ jsxs(
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
return /* @__PURE__ */ jsxs(BearContext.Provider, { value: storeRef.current, children: [
|
|
92
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
93
|
+
"backendurl: ",
|
|
94
|
+
storeRef.current.getState().backendUrl
|
|
95
95
|
] }),
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
|
|
96
|
+
/* @__PURE__ */ jsxs(MtConnectProvider, { children: [
|
|
97
|
+
/* @__PURE__ */ jsxs(MtReactQueryProvider, { children: [
|
|
98
|
+
/* @__PURE__ */ jsx(GoMtmDebug, {}),
|
|
99
|
+
children
|
|
100
|
+
] }),
|
|
101
|
+
/* @__PURE__ */ jsx(Setup, {})
|
|
102
|
+
] })
|
|
103
|
+
] });
|
|
98
104
|
};
|
|
99
105
|
function useGomtm(selector) {
|
|
100
106
|
const store = useContext(BearContext);
|
|
@@ -116,7 +122,8 @@ const MtConnectProvider = (props) => {
|
|
|
116
122
|
const backendUrl = useGomtm((x) => x.backendUrl);
|
|
117
123
|
const cookieStr = useGomtm((x) => x.cookieStr);
|
|
118
124
|
const transport = useMemo(() => {
|
|
119
|
-
const baseApiUrl = new URL(
|
|
125
|
+
const baseApiUrl = new URL(MTM_API_PREFIX, backendUrl || "").toString();
|
|
126
|
+
console.log("MtConnectProvider, baseApiUrl:", baseApiUrl);
|
|
120
127
|
return createConnectTransport({
|
|
121
128
|
baseUrl: baseApiUrl,
|
|
122
129
|
fetch: gomtmFetcher({
|