@akylas/nativescript-app-utils 2.2.4 → 2.2.5
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 +4 -0
- package/package.json +2 -2
- package/worker/BaseWorkerHandler.js +29 -29
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.2.5](https://github.com/akylas/nativescript-app-utils/compare/v2.2.4...v2.2.5) (2025-02-07)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @akylas/nativescript-app-utils
|
|
9
|
+
|
|
6
10
|
## [2.2.4](https://github.com/akylas/nativescript-app-utils/compare/v2.2.3...v2.2.4) (2025-02-07)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @akylas/nativescript-app-utils
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akylas/nativescript-app-utils",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.5",
|
|
4
4
|
"description": "Provides API for changing the styles of SystemUI (StatusBar, NavigationBar...) on iOS.",
|
|
5
5
|
"main": "index",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"@nativescript-community/ui-share-file": "1.3.3"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "9ba272e485de9d47258e9d1082967c1498cdb325"
|
|
70
70
|
}
|
|
@@ -82,36 +82,36 @@ export default class BaseWorkerHandler extends Observable {
|
|
|
82
82
|
if (!isResponse && (id || timeout)) {
|
|
83
83
|
return new Promise(async (resolve, reject) => {
|
|
84
84
|
// const id = Date.now().valueOf();
|
|
85
|
-
id = id || time();
|
|
86
|
-
this.messagePromises[id] = this.messagePromises[id] || [];
|
|
87
|
-
let timeoutTimer;
|
|
88
|
-
if (timeout > 0) {
|
|
89
|
-
timeoutTimer = setTimeout(() => {
|
|
90
|
-
// we need to try catch because the simple fact of creating a new Error actually throws.
|
|
91
|
-
// so we will get an uncaughtException
|
|
92
|
-
try {
|
|
93
|
-
reject(new Error('timeout'));
|
|
94
|
-
}
|
|
95
|
-
catch { }
|
|
96
|
-
delete this.messagePromises[id];
|
|
97
|
-
}, timeout);
|
|
98
|
-
}
|
|
99
|
-
this.messagePromises[id].push({ reject, resolve, timeoutTimer });
|
|
100
|
-
const keys = Object.keys(nativeData);
|
|
101
|
-
const nativeDataKeysPrefix = Date.now() + '$$$';
|
|
102
|
-
keys.forEach((k) => {
|
|
103
|
-
setWorkerContextValue(nativeDataKeysPrefix + k, nativeData[k]._native || nativeData[k]);
|
|
104
|
-
});
|
|
105
|
-
const data = {
|
|
106
|
-
error: !!error ? JSON.stringify(error.toJSON() ? error.toJSON() : { message: error.toString(), ...error }) : undefined,
|
|
107
|
-
id,
|
|
108
|
-
nativeDataKeysPrefix,
|
|
109
|
-
messageData: !!messageData ? JSON.stringify(messageData) : undefined,
|
|
110
|
-
nativeData: keys.map((k) => nativeDataKeysPrefix + k),
|
|
111
|
-
type
|
|
112
|
-
};
|
|
113
|
-
// DEV_LOG && console.info('Sync', 'postMessage', JSON.stringify(data));
|
|
114
85
|
try {
|
|
86
|
+
id = id || time();
|
|
87
|
+
this.messagePromises[id] = this.messagePromises[id] || [];
|
|
88
|
+
let timeoutTimer;
|
|
89
|
+
if (timeout > 0) {
|
|
90
|
+
timeoutTimer = setTimeout(() => {
|
|
91
|
+
// we need to try catch because the simple fact of creating a new Error actually throws.
|
|
92
|
+
// so we will get an uncaughtException
|
|
93
|
+
try {
|
|
94
|
+
reject(new Error('timeout'));
|
|
95
|
+
}
|
|
96
|
+
catch { }
|
|
97
|
+
delete this.messagePromises[id];
|
|
98
|
+
}, timeout);
|
|
99
|
+
}
|
|
100
|
+
this.messagePromises[id].push({ reject, resolve, timeoutTimer });
|
|
101
|
+
const keys = nativeData ? Object.keys(nativeData) : [];
|
|
102
|
+
const nativeDataKeysPrefix = Date.now() + '$$$';
|
|
103
|
+
keys.forEach((k) => {
|
|
104
|
+
setWorkerContextValue(nativeDataKeysPrefix + k, nativeData[k]._native || nativeData[k]);
|
|
105
|
+
});
|
|
106
|
+
const data = {
|
|
107
|
+
error: !!error ? JSON.stringify(error.toJSON() ? error.toJSON() : { message: error.toString(), ...error }) : undefined,
|
|
108
|
+
id,
|
|
109
|
+
nativeDataKeysPrefix,
|
|
110
|
+
messageData: !!messageData ? JSON.stringify(messageData) : undefined,
|
|
111
|
+
nativeData: keys.map((k) => nativeDataKeysPrefix + k),
|
|
112
|
+
type
|
|
113
|
+
};
|
|
114
|
+
// DEV_LOG && console.info('Sync', 'postMessage', JSON.stringify(data));
|
|
115
115
|
await this.internalSendMessageToWorker(data);
|
|
116
116
|
}
|
|
117
117
|
catch (error) {
|