dirk-cfx-react 1.1.35 → 1.1.36

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
@@ -237,16 +237,6 @@ var useSettings = create(() => ({
237
237
  "#0b33ff"
238
238
  ]
239
239
  }));
240
- registerInitialFetch("GET_SETTINGS", void 0).then((data) => {
241
- console.log("Fetched settings:", data);
242
- if (!data) {
243
- console.warn("No settings data received from GET_SETTINGS fetch.");
244
- return;
245
- }
246
- useSettings.setState({
247
- ...data
248
- });
249
- });
250
240
 
251
241
  // src/utils/fetchNui.ts
252
242
  async function fetchNui(eventName, data, mockData) {
@@ -2503,6 +2493,15 @@ function DirkProvider({ children, overideResourceName, themeOverride }) {
2503
2493
  overideResourceName
2504
2494
  });
2505
2495
  }, [overideResourceName]);
2496
+ useEffect(() => {
2497
+ fetchNui("GET_SETTINGS").then((data) => {
2498
+ useSettings.setState({
2499
+ ...data
2500
+ });
2501
+ }).catch((err) => {
2502
+ console.error("Failed to fetch initial settings within dirk-cfx-react:", err);
2503
+ });
2504
+ }, []);
2506
2505
  const mergedTheme = useMemo(
2507
2506
  () => mergeMantineThemeSafe(
2508
2507
  { ...theme_default, primaryColor, primaryShade },