Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin committed Oct 29, 2023
1 parent 24ddcaf commit f584a25
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions dev-portal/backend/public/allinlib.js
Expand Up @@ -15,8 +15,8 @@ async function upsertDb(key, value) {
});
window.parent.postMessage(message, '*');
window.addEventListener('message', async function (event) {
console.log(event.data);
if (event.data.messageId === mId) {
eData = JSON.parse(event.data);
if (eData.messageId === mId) {
res();
}
});
Expand All @@ -42,7 +42,7 @@ async function listDb() {
});
}

async function account(key, value) {
async function account() {
return new Promise((res, rej) => {
const mId = nextMessageId();

Expand All @@ -52,15 +52,15 @@ async function account(key, value) {
});
window.parent.postMessage(message, '*');
window.addEventListener('message', async function (event) {
console.log(event.data);
if (event.data.messageId === mId) {
res(JSON.parse(event.data.account));
eData = JSON.parse(event.data);
if (eData.messageId === mId) {
res(eData.account);
}
});
});
}

async function user(key, value) {
async function user() {
return new Promise((res, rej) => {
const mId = nextMessageId();

Expand All @@ -70,9 +70,9 @@ async function user(key, value) {
});
window.parent.postMessage(message, '*');
window.addEventListener('message', async function (event) {
console.log(event.data);
if (event.data.messageId === mId) {
res(JSON.parse(event.data.user));
eData = JSON.parse(event.data);
if (eData.messageId === mId) {
res(eData.user);
}
});
});
Expand Down

0 comments on commit f584a25

Please sign in to comment.