dirk-cfx-react 1.1.46 → 1.1.48

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.js CHANGED
@@ -2309,10 +2309,15 @@ function TornEdgeSVGFilter() {
2309
2309
  }
2310
2310
  function createScriptSettings(defaultValue) {
2311
2311
  const store = create(() => defaultValue);
2312
- const useScriptSettingHooks = () => {
2313
- useNuiEvent("UPDATE_SCRIPT_SETTINGS", (newSettings) => {
2314
- store.setState((prev) => ({ ...prev, ...newSettings }));
2312
+ if (typeof window !== "undefined") {
2313
+ window.addEventListener("message", (event) => {
2314
+ if (event.data?.action === "UPDATE_SCRIPT_SETTINGS" && event.data?.data) {
2315
+ console.log("[scriptSettings] UPDATE_SCRIPT_SETTINGS received", event.data.data);
2316
+ store.setState((prev) => ({ ...prev, ...event.data.data }));
2317
+ }
2315
2318
  });
2319
+ }
2320
+ const useScriptSettingHooks = () => {
2316
2321
  };
2317
2322
  const updateScriptSettings = async (newSettings) => {
2318
2323
  store.setState((prev) => ({ ...prev, ...newSettings }));