esoftplay 0.0.107-e → 0.0.107-i

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/bin/router.js CHANGED
@@ -108,7 +108,6 @@ checks.forEach(modules => {
108
108
  return console.log(err)
109
109
  } else {
110
110
  var isIndexed = (tmpExp.indexOf(clsName) > -1) ? false : true;
111
- // console.log(isIndexed, clsName);
112
111
  var isHooks = false
113
112
  var isUseLibs = false
114
113
  /* REGEX HOOKS */
@@ -509,43 +508,6 @@ function isChange(path, compare) {
509
508
  /* CREATE REDUCER LIST */
510
509
  function createReducer() {
511
510
  if (countRead >= countLoop) {
512
- // var CodeImporter = "";
513
- // var CodeReducer = "";
514
- // for (const key in Reducers) {
515
- // if (HookReducers.includes(key)) {
516
- // CodeImporter += "\nimport * as " + key + " from '../../." + Reducers[key] + "';";
517
- // } else {
518
- // CodeImporter += "\nimport " + key + " from '../../." + Reducers[key] + "';";
519
- // }
520
- // CodeReducer += "\n\t" + key + ": " + key + ".reducer,";
521
- // }
522
- // if (CodeReducer != "") {
523
- // CodeReducer = CodeReducer.substr(0, CodeReducer.length - 1);
524
- // }
525
- // Text = "import { combineReducers } from 'redux'" +
526
- // "\nimport { persistReducer } from 'redux-persist'" +
527
- // "\nimport AsyncStorage from '@react-native-async-storage/async-storage'" + CodeImporter +
528
- // "\n\nconst combiner = combineReducers({" + CodeReducer +
529
- // "\n})\n\n" +
530
- // "\nconst persistConfig = {" +
531
- // "\n\tkey: 'root'," +
532
- // "\n\tstorage: AsyncStorage," +
533
- // "\n\twhitelist: ['" + Object.keys(Persistor).join('\',\'') + "']" +
534
- // "\n}" +
535
- // "\nconst reducers = (state, action) => {" +
536
- // "\n\tif (action.type === 'user_class_delete') {" +
537
- // "\n\t\tstate = undefined" +
538
- // "\n\t}" +
539
- // "\n\treturn combiner(state, action)" +
540
- // "\n }" +
541
- // "\nexport default persistReducer(persistConfig, reducers)";
542
- // if (isChange(tmpDir + "reducers.js", Text)) {
543
- // fs.writeFile(tmpDir + "reducers.js", Text, { flag: 'w' }, function (err) {
544
- // if (err) {
545
- // return console.log(err);
546
- // }
547
- // })
548
- // }
549
511
  createRouter()
550
512
  createIndex();
551
513
  } else {
@@ -587,7 +549,6 @@ function createRouter() {
587
549
  item += "" +
588
550
  "import * as " + ucword(module) + ucword(task) + SuffixHooksProperty + " from '../../." + Modules[module][task] + "';\n" +
589
551
  "const " + ucword(module) + ucword(task) + " = React.memo(_" + ucword(module) + ucword(task) + ", isEqual); \n" +
590
- // "const " + ucword(module) + ucword(task) + " = _" + ucword(module) + ucword(task) + "; \n" +
591
552
  "export { " + ucword(module) + ucword(task) + SuffixHooksProperty + ", " + ucword(module) + ucword(task) + " };\n"
592
553
  } else if (UseLibs.includes(nav)) {
593
554
  item += "" +
@@ -656,7 +617,7 @@ function createRouter() {
656
617
  screens.push("\t\t\t\t<Stack.Screen name={\"" + nav + "\"} component={" + comp + "} />")
657
618
  })
658
619
 
659
- let N = Nav5(importer.join(", \n"), screens.join("\n"))
620
+ let N = Nav5(importer.join(", "), screens.join("\n"))
660
621
  if (isChange(tmpDir + 'navs.tsx', N))
661
622
  fs.writeFile(tmpDir + "navs.tsx", N, { flag: 'w' }, function (err) {
662
623
  if (err) {
@@ -12,7 +12,7 @@ export interface LibUpdaterProps {
12
12
  }
13
13
 
14
14
  export function install(): void {
15
- Updates.reloadAsync()
15
+ setTimeout(Updates.reloadAsync)
16
16
  }
17
17
 
18
18
  export function alertInstall(title?: string, msg?: string): void {
@@ -6,12 +6,19 @@ import { useCallback, useEffect } from 'react';
6
6
  import { Alert, Linking } from 'react-native';
7
7
 
8
8
  export default function m(defaultUrl?: string): void {
9
- const doLink = useCallback(({ url }: any) => {
9
+ const doLink = useCallback(({ url }: { url: string }) => {
10
10
  const { domain, uri } = esp.config()
11
11
  if (url?.includes(defaultUrl || domain))
12
12
  LibUtils.debounce(() => {
13
13
  url = url.replace((domain + uri), (domain + uri + 'deeplink/'))
14
- new LibCurl().custom(url, null,
14
+ function removeLastDot(url: string) {
15
+ if (url.substr(url.length - 1, 1) == '.') {
16
+ url = url.substring(0, url.length - 1)
17
+ return removeLastDot(url)
18
+ }
19
+ return url
20
+ }
21
+ new LibCurl().custom(removeLastDot(url), null,
15
22
  (res) => {
16
23
  if (res.ok == 1) {
17
24
  function nav(module: string, url: string) {
@@ -20,6 +27,7 @@ export default function m(defaultUrl?: string): void {
20
27
  nav(module, url)
21
28
  }, 500);
22
29
  } else {
30
+ //@ts-nocheck
23
31
  LibNavigation.push(module, { url: url })
24
32
  }
25
33
  }
@@ -5,7 +5,7 @@ import { esp, LibDialog, LibImage, LibNet_status, LibProgress, LibStyle, LibToas
5
5
  import * as Font from "expo-font";
6
6
  import firebase from 'firebase';
7
7
  import React, { useEffect, useMemo } from "react";
8
- import { View } from "react-native";
8
+ import { Alert, View } from "react-native";
9
9
  //@ts-ignore
10
10
  import Navs from "../../cache/navs";
11
11
 
@@ -47,6 +47,14 @@ export default function m(props: UserIndexProps): any {
47
47
  }
48
48
 
49
49
  useMemo(() => {
50
+ const timeout = setTimeout(() => {
51
+ Alert.alert("Yey...! Pembaharuan sudah selesai", "Silahkan mulai ulang aplikasi kamu", [
52
+ {
53
+ onPress: () => LibUpdaterProperty.install(),
54
+ text: "Mulai Ulang Sekarang"
55
+ }
56
+ ], { cancelable: false })
57
+ }, 30 * 1000);
50
58
  if (esp.config('firebase').hasOwnProperty('apiKey')) {
51
59
  if (!firebase.apps.length) {
52
60
  firebase.initializeApp(esp.config('firebase'));
@@ -59,6 +67,7 @@ export default function m(props: UserIndexProps): any {
59
67
  if (isNew) {
60
68
  LibUpdaterProperty.install()
61
69
  } else {
70
+ clearTimeout(timeout)
62
71
  setLoading(false)
63
72
  }
64
73
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esoftplay",
3
- "version": "0.0.107-e",
3
+ "version": "0.0.107-i",
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",