Skip to content

Commit

Permalink
popup styling
Browse files Browse the repository at this point in the history
  • Loading branch information
andreigiura committed Mar 28, 2024
1 parent c5ec278 commit 7f09f38
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@multiversx/sdk-web-wallet-cross-window-provider",
"version": "0.0.28-alpha.11",
"version": "0.0.28-alpha.12",
"description": "Signing provider for dApps: Cross Window",
"main": "out/index.js",
"types": "out/index.d.js",
Expand Down
6 changes: 1 addition & 5 deletions src/CrossWindowProvider/CrossWindowProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ export class CrossWindowProvider {
}

protected async openPopupConsent(): Promise<boolean> {
const dialog = safeWindow.document?.createElement('dialog');
const dialog = safeWindow.document?.createElement('div');
const document = safeWindow.document;
if (!this._shouldShowConsentPopup || !document || !dialog) {
return true;
Expand All @@ -298,25 +298,21 @@ export class CrossWindowProvider {
dialog.innerHTML = getMarkup(this.windowManager.walletUrl);

document.body.appendChild(dialog);
dialog.showModal();
const popupConsentResponse: boolean = await new Promise((resolve) => {
const confirmButton = document.getElementById(confirmId);
const cancelButton = document.getElementById(cancelId);

if (!confirmButton || !cancelButton) {
resolve(true);
dialog.close();
document.body.removeChild(dialog);
return;
}
confirmButton.addEventListener('click', function () {
resolve(true);
dialog.close();
document.body.removeChild(dialog);
});
cancelButton.addEventListener('click', function () {
resolve(false);
dialog.close();
document.body.removeChild(dialog);
});
});
Expand Down

0 comments on commit 7f09f38

Please sign in to comment.