[Addon] Fix showMessageBox function 98/230798/2
authorws29.jung <ws29.jung@samsung.com>
Tue, 14 Apr 2020 08:02:09 +0000 (17:02 +0900)
committerws29.jung <ws29.jung@samsung.com>
Tue, 14 Apr 2020 08:36:29 +0000 (17:36 +0900)
Old version of Electron only had 'showMessageBox' function,
and it handled sync and async mode under binded C++ function.
Now new Electron export 'showMessageBoxSync' function separatly
and it works as sync mode of old 'showMessageBox'.
To handle both functions with one source code, this patch makes
addonapi method to use logical function fallback.

Change-Id: I36a73106d451672c51c3aebbd1ecb92a25be3c02
Signed-off-by: ws29.jung <ws29.jung@samsung.com>
wrt_app/addon/browser/modules/window.js

index c7a92f2227385427678adddf2dfa164bca46cff8..44e779dafeecd3340633ac50341d62848b257f6a 100644 (file)
@@ -10,11 +10,12 @@ module.exports = {
 
   showMessageBox: function (winId, options) {
     let window = TopLevelWindow.fromId(winId);
-    dialog.showMessageBox(window, options, null);
+    let showMessageBox = (dialog.showMessageBoxSync || dialog.showMessageBox);
+    showMessageBox(window, options);
   },
 
   show: function (winId) {
     let window = TopLevelWindow.fromId(winId);
     window.show();
   }
-}
\ No newline at end of file
+}