Comparing version 0.0.8 to 0.0.9
43
index.js
@@ -11,3 +11,3 @@ var portalPostMessage; | ||
getSignedRequest: onPrepareSignedRequest, | ||
getPlatform: function() { | ||
getPlatform: function () { | ||
return platform; | ||
@@ -17,6 +17,6 @@ }, | ||
showToast: onShowToast, | ||
showLoading: function() { | ||
showLoading: function () { | ||
onToggleLoader(true); | ||
}, | ||
hideLoading: function() { | ||
hideLoading: function () { | ||
onToggleLoader(false); | ||
@@ -34,3 +34,3 @@ }, | ||
async function onPrepareSignedRequest({ success, fail }) { | ||
var signedRequest = ''; | ||
@@ -54,3 +54,3 @@ | ||
}; | ||
if (typeof event.data !== 'string') return; | ||
if (!event.data.startsWith("{") && !event.data.startsWith("setImmediate")) { | ||
@@ -61,12 +61,11 @@ success({ signedRequest: event.data, platform: platform }); | ||
}) | ||
window.onhashchange = function () { | ||
portalPostMessage({ | ||
action: 'URL_CHANGE', | ||
message: window.location.href, | ||
}) | ||
} | ||
return; | ||
} | ||
}, false); | ||
window.onhashchange = function() { | ||
portalPostMessage({ | ||
action: 'URL_CHANGE', | ||
message: window.location.href, | ||
}) | ||
} | ||
} | ||
@@ -86,7 +85,7 @@ | ||
); | ||
var elem = window.revenuemonster.os === 'android' ? document : window; | ||
elem.addEventListener( | ||
'message', | ||
function(event) { | ||
function (event) { | ||
var msg = JSON.parse(event.data); | ||
@@ -123,3 +122,3 @@ if (msg.action === 'SCANNER') { | ||
break; | ||
case PLATFORM_TERMINAL: | ||
@@ -146,5 +145,5 @@ window.Native.toggleLoader(isLoading); | ||
}) | ||
); | ||
); | ||
break; | ||
case PLATFORM_TERMINAL: | ||
@@ -174,3 +173,3 @@ window.Native.showToast(message); | ||
break; | ||
case PLATFORM_TERMINAL: | ||
@@ -189,6 +188,6 @@ window.Native.showMessageDialog(title); | ||
} | ||
} | ||
export default { | ||
export default { | ||
getSignedRequest: onPrepareSignedRequest, | ||
@@ -208,5 +207,5 @@ getPlatform: function getPlatform() { | ||
printReceipt: onPrintReceipt, | ||
PLATFORM_MOBILE_APP, | ||
PLATFORM_TERMINAL, | ||
PLATFORM_MOBILE_APP, | ||
PLATFORM_TERMINAL, | ||
PLATFORM_WEB_PORTAL | ||
}; |
@@ -68,3 +68,3 @@ "use strict"; | ||
}); | ||
_context.next = 21; | ||
_context.next = 20; | ||
break; | ||
@@ -88,3 +88,3 @@ | ||
}); | ||
_context.next = 21; | ||
_context.next = 20; | ||
break; | ||
@@ -99,2 +99,4 @@ | ||
if (typeof event.data !== 'string') return; | ||
if (!event.data.startsWith("{") && !event.data.startsWith("setImmediate")) { | ||
@@ -108,2 +110,10 @@ success({ | ||
}); | ||
window.onhashchange = function () { | ||
portalPostMessage({ | ||
action: 'URL_CHANGE', | ||
message: window.location.href | ||
}); | ||
}; | ||
return; | ||
@@ -113,13 +123,6 @@ } | ||
window.onhashchange = function () { | ||
portalPostMessage({ | ||
action: 'URL_CHANGE', | ||
message: window.location.href | ||
}); | ||
}; | ||
case 20: | ||
return _context.abrupt("return", signedRequest); | ||
case 21: | ||
return _context.abrupt("return", signedRequest); | ||
case 22: | ||
case "end": | ||
@@ -126,0 +129,0 @@ return _context.stop(); |
{ | ||
"name": "rm-plugin", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "", |
17718
425