esoftplay 0.0.115-k → 0.0.115-n
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/modules/lib/worker.tsx +9 -4
- package/modules/lib/workview.tsx +2 -1
- package/modules/user/index.tsx +6 -11
- package/package.json +1 -1
package/modules/lib/worker.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// noPage
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { useGlobalReturn, useGlobalState } from 'esoftplay';
|
|
4
4
|
import React, { Component } from "react";
|
|
5
5
|
import { Platform } from 'react-native';
|
|
6
6
|
|
|
@@ -16,17 +16,22 @@ export interface LibWorkerProps {
|
|
|
16
16
|
export interface LibWorkerState {
|
|
17
17
|
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
const _global = require('../../_global')
|
|
20
20
|
_global.LibWorkerBase = React.createRef()
|
|
21
21
|
_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
|
-
|
|
160
|
+
m.workerState().set(1)
|
|
156
161
|
return
|
|
157
162
|
}
|
|
158
163
|
const dt = e.nativeEvent.data
|
package/modules/lib/workview.tsx
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
// withHooks
|
|
2
2
|
// noPage
|
|
3
3
|
|
|
4
|
-
import { esp, LibWorker
|
|
4
|
+
import { esp, LibWorker } from 'esoftplay';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { Platform, View } from 'react-native';
|
|
7
7
|
import WebView from 'react-native-webview';
|
|
8
|
+
const _global = require('../../_global')
|
|
8
9
|
|
|
9
10
|
export interface LibWorkviewArgs {
|
|
10
11
|
|
package/modules/user/index.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
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,
|
|
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
|
-
import React, { useEffect
|
|
6
|
+
import React, { useEffect } from "react";
|
|
7
7
|
import { Platform, View } from "react-native";
|
|
8
8
|
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
9
9
|
import Navs from "../../cache/navs";
|
|
@@ -30,16 +30,12 @@ function setFonts(): Promise<void> {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
|
|
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 =
|
|
36
|
+
const [worker] = LibWorker.workerState().useState()
|
|
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
|
|
@@ -52,7 +48,7 @@ export default function m(props: UserIndexProps): any {
|
|
|
52
48
|
UserRoutes.set(currentState)
|
|
53
49
|
}
|
|
54
50
|
|
|
55
|
-
|
|
51
|
+
useEffect(() => {
|
|
56
52
|
// const timeout = setTimeout(() => {
|
|
57
53
|
// setLoading(false)
|
|
58
54
|
// }, 15 * 1000);
|
|
@@ -62,9 +58,8 @@ export default function m(props: UserIndexProps): any {
|
|
|
62
58
|
limitReady = 2
|
|
63
59
|
}
|
|
64
60
|
|
|
65
|
-
if (worker == 1
|
|
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
|
}
|