react-toolkits 2.14.0 → 2.14.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # react-toolkits
2
2
 
3
+ ## 2.14.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 751ca52: fix: cancel games fetching when current permission is V1
8
+
3
9
  ## 2.14.0
4
10
 
5
11
  ### Minor Changes
package/lib/index.js CHANGED
@@ -665,16 +665,19 @@ var init_hooks3 = __esm({
665
665
  "src/components/layout/hooks.ts"() {
666
666
  init_toolkitsProvider();
667
667
  useGames = () => {
668
- const { axios: axios2, gameApiV2 } = useToolkitsStore((s) => s);
669
- return useSWR6(gameApiV2 ? "/api/game/list" : "/api/usystem/game/all", async (url4) => {
670
- if (gameApiV2) {
671
- const response = await axios2(url4);
672
- return response.data.data.list ?? [];
673
- } else {
674
- const response = await axios2(url4);
675
- return response.data.data ?? [];
668
+ const { axios: axios2, gameApiV2, permissionVersion } = useToolkitsStore((s) => s);
669
+ return useSWR6(
670
+ permissionVersion !== "v1" /* V1 */ ? gameApiV2 ? "/api/game/list" : "/api/usystem/game/all" : null,
671
+ async (url4) => {
672
+ if (gameApiV2) {
673
+ const response = await axios2(url4);
674
+ return response.data.data.list ?? [];
675
+ } else {
676
+ const response = await axios2(url4);
677
+ return response.data.data ?? [];
678
+ }
676
679
  }
677
- });
680
+ );
678
681
  };
679
682
  useFindGame = (id2) => {
680
683
  const { data } = useGames();