fix: standalone@2.1.2: fix #158
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cap-standalone",
|
||||
"version": "2.1.1",
|
||||
"version": "2.1.2",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"dev": "bun run --watch src/index.js",
|
||||
|
||||
@@ -28,8 +28,9 @@ const api = async (method, path, body) => {
|
||||
opts.body = JSON.stringify(body);
|
||||
}
|
||||
|
||||
return await await fetch(`/server${path}`, opts).json();
|
||||
return await (await fetch(`/server${path}`, opts)).json();
|
||||
} catch (e) {
|
||||
console.error("standalone:", e)
|
||||
return { error: e.message };
|
||||
}
|
||||
};
|
||||
@@ -91,7 +92,7 @@ async function loadKeys() {
|
||||
location.reload();
|
||||
return;
|
||||
}
|
||||
if (keys.error) {
|
||||
if (keys?.error) {
|
||||
keysList.innerHTML = `<div class="keys-empty"><p>Error loading keys</p></div>`;
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user