npm package diff
Package: @forge/bridge
Versions: 4.0.0 - 4.0.1-next.0
File: package/out/modal/modal.js
Index: package/out/modal/modal.js
===================================================================
--- package/out/modal/modal.js
+++ package/out/modal/modal.js
@@ -1,8 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Modal = void 0;
-const tslib_1 = require("tslib");
const bridge_1 = require("../bridge");
const errors_1 = require("../errors");
const callBridge = (0, bridge_1.getCallBridge)();
const noop = () => { };
@@ -15,26 +14,24 @@
this.context = (opts === null || opts === void 0 ? void 0 : opts.context) || {};
this.closeOnEscape = (_a = opts === null || opts === void 0 ? void 0 : opts.closeOnEscape) !== null && _a !== void 0 ? _a : true;
this.closeOnOverlayClick = (_b = opts === null || opts === void 0 ? void 0 : opts.closeOnOverlayClick) !== null && _b !== void 0 ? _b : true;
}
- open() {
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
- try {
- const success = yield callBridge('openModal', {
- resource: this.resource,
- onClose: this.onClose,
- size: this.size,
- context: this.context,
- closeOnEscape: this.closeOnEscape,
- closeOnOverlayClick: this.closeOnOverlayClick
- });
- if (success === false) {
- throw new errors_1.BridgeAPIError('Unable to open modal.');
- }
- }
- catch (err) {
+ async open() {
+ try {
+ const success = await callBridge('openModal', {
+ resource: this.resource,
+ onClose: this.onClose,
+ size: this.size,
+ context: this.context,
+ closeOnEscape: this.closeOnEscape,
+ closeOnOverlayClick: this.closeOnOverlayClick
+ });
+ if (success === false) {
throw new errors_1.BridgeAPIError('Unable to open modal.');
}
- });
+ }
+ catch (err) {
+ throw new errors_1.BridgeAPIError('Unable to open modal.');
+ }
}
}
exports.Modal = Modal;