Skip to content

Commit 1b2e492

Browse files
committed
fix(ci): restore runtime bridge invoke contract strings
1 parent 62bb5a9 commit 1b2e492

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

src/frontend/runtime_bridge.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -237,18 +237,18 @@
237237
return window.__TAURI__.core.invoke;
238238
}
239239

240-
function invokeTauriWithTimeout(invoke, command, args, timeoutMs) {
240+
function invokeTauriWithTimeout(invokeCall, commandLabel, timeoutMs) {
241241
return new Promise((resolve, reject) => {
242242
let settled = false;
243243
const timer = setTimeout(() => {
244244
if (settled) {
245245
return;
246246
}
247247
settled = true;
248-
reject(new Error(`Tauri invoke timed out (${command}).`));
248+
reject(new Error(`Tauri invoke timed out (${commandLabel}).`));
249249
}, timeoutMs);
250250

251-
Promise.resolve(invoke(command, args))
251+
Promise.resolve(invokeCall())
252252
.then((result) => {
253253
if (settled) {
254254
return;
@@ -281,9 +281,8 @@
281281

282282
try {
283283
const caps = await invokeTauriWithTimeout(
284-
invoke,
284+
() => invoke('get_runtime_capabilities'),
285285
'get_runtime_capabilities',
286-
undefined,
287286
TAURI_RUNTIME_HYDRATE_TIMEOUT_MS
288287
);
289288
if (caps && typeof caps === 'object') {
@@ -296,9 +295,8 @@
296295
const runtimeCaps = window.__NC_RUNTIME_CAPS || {};
297296
if (runtimeCaps.supports_sidecar) {
298297
const runtimeConfig = await invokeTauriWithTimeout(
299-
invoke,
298+
() => invoke('get_sidecar_runtime_config'),
300299
'get_sidecar_runtime_config',
301-
undefined,
302300
TAURI_RUNTIME_HYDRATE_TIMEOUT_MS
303301
);
304302
setRuntimeConfig(runtimeConfig);

0 commit comments

Comments
 (0)