taler-wallet-core ios compatibility
This commit is contained in:
parent
f448f94aea
commit
4f88d7f896
@ -28,11 +28,15 @@ const logger = new Logger("nodeThreadWorker.ts");
|
|||||||
const f = __filename;
|
const f = __filename;
|
||||||
|
|
||||||
const workerCode = `
|
const workerCode = `
|
||||||
// Try loading the glue library for Android
|
// Try loading the glue library for embedded
|
||||||
try {
|
try {
|
||||||
require("akono");
|
require("akono");
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Probably we're not on Android ...
|
try {
|
||||||
|
require("iono");
|
||||||
|
} catch (e2) {
|
||||||
|
// Probably we're not on embedded ...
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const worker_threads = require('worker_threads');
|
const worker_threads = require('worker_threads');
|
||||||
const parentPort = worker_threads.parentPort;
|
const parentPort = worker_threads.parentPort;
|
||||||
@ -44,9 +48,9 @@ const workerCode = `
|
|||||||
}
|
}
|
||||||
if (!tw) {
|
if (!tw) {
|
||||||
try {
|
try {
|
||||||
tw = require("@gnu-taler/taler-wallet-android");
|
tw = require("@gnu-taler/taler-wallet-embedded");
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn("could not load taler-wallet-android either");
|
console.warn("could not load taler-wallet-embedded either");
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -637,7 +637,7 @@ async function dispatchRequestInternal(
|
|||||||
operation: string,
|
operation: string,
|
||||||
payload: unknown,
|
payload: unknown,
|
||||||
): Promise<Record<string, any>> {
|
): Promise<Record<string, any>> {
|
||||||
if (ws.initCalled && operation !== "initWallet") {
|
if (!ws.initCalled && operation !== "initWallet") {
|
||||||
throw Error(
|
throw Error(
|
||||||
`wallet must be initialized before running operation ${operation}`,
|
`wallet must be initialized before running operation ${operation}`,
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user