esoftplay 0.0.115-k → 0.0.115-l

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.
@@ -1,6 +1,6 @@
1
1
  // noPage
2
2
 
3
- import { UserIndexProperty, _global } from 'esoftplay';
3
+ import { useGlobalReturn, useGlobalState, _global } from 'esoftplay';
4
4
  import React, { Component } from "react";
5
5
  import { Platform } from 'react-native';
6
6
 
@@ -22,11 +22,16 @@ _global.LibWorkerTasks = new Map()
22
22
  _global.injectedJavaScripts = []
23
23
  _global.LibWorkerReady = 0
24
24
  _global.LibWorkerCount = 0
25
+ const state = useGlobalState(null)
25
26
  export default class m extends Component<LibWorkerProps, LibWorkerState> {
26
27
  constructor(props: LibWorkerProps) {
27
28
  super(props)
28
29
  }
29
-
30
+
31
+ static workerState(): useGlobalReturn<any> {
32
+ return state
33
+ }
34
+
30
35
  static delete(taskId: string): void {
31
36
  _global.LibWorkerTasks.delete(taskId)
32
37
  }
@@ -152,7 +157,7 @@ export default class m extends Component<LibWorkerProps, LibWorkerState> {
152
157
  return (e: any) => {
153
158
  if (e.nativeEvent.data == withRefName) {
154
159
  _global.LibWorkerReady += 1
155
- UserIndexProperty.workerState().set(1)
160
+ m.workerState().set(1)
156
161
  return
157
162
  }
158
163
  const dt = e.nativeEvent.data
@@ -1,7 +1,7 @@
1
1
  // withHooks
2
2
  // noPage
3
3
 
4
- import { ChattingFirebase, esp, LibDialog, LibImage, LibNet_status, LibProgress, LibStyle, LibToast, LibUpdaterProperty, LibVersion, LibWorker, LibWorkloop, LibWorkview, UseDeeplink, useGlobalReturn, useGlobalState, UserClass, UserLoading, UserMain, UserRoutes, useSafeState, _global } from 'esoftplay';
4
+ import { ChattingFirebase, esp, LibDialog, LibImage, LibNet_status, LibProgress, LibStyle, LibToast, LibUpdaterProperty, LibVersion, LibWorker, LibWorkloop, LibWorkview, UseDeeplink, UserClass, UserLoading, UserMain, UserRoutes, useSafeState, _global } from 'esoftplay';
5
5
  import * as Font from "expo-font";
6
6
  import React, { useEffect, useLayoutEffect } from "react";
7
7
  import { Platform, View } from "react-native";
@@ -30,16 +30,12 @@ function setFonts(): Promise<void> {
30
30
  }
31
31
 
32
32
 
33
- const state = useGlobalState(null)
34
- export function workerState(): useGlobalReturn<any> {
35
- return state
36
- }
33
+
37
34
  export default function m(props: UserIndexProps): any {
38
35
  const [loading, setLoading] = useSafeState(true)
39
- const worker = state.useSelector((x) => x)
36
+ const worker = LibWorker.workerState().useSelector((x) => x)
40
37
  const user = UserClass.state().useSelector(s => s)
41
38
  const ready = React.useRef(0)
42
- const workerReady = React.useRef(false)
43
39
  UseDeeplink()
44
40
  //@ts-ignore
45
41
  const initialState = __DEV__ ? _global.nav__state : undefined
@@ -62,9 +58,8 @@ export default function m(props: UserIndexProps): any {
62
58
  limitReady = 2
63
59
  }
64
60
 
65
- if (worker == 1 && !workerReady.current) {
61
+ if (worker == 1) {
66
62
  ready.current += 1
67
- workerReady.current = true
68
63
  if (ready.current >= limitReady) {
69
64
  setLoading(false)
70
65
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esoftplay",
3
- "version": "0.0.115-k",
3
+ "version": "0.0.115-l",
4
4
  "description": "embedding data from esoftplay framework (web based) into mobile app",
5
5
  "main": "cache/index.js",
6
6
  "types": "../../index.d.ts",