mirror of
https://github.com/fluxscape/fluxscape.git
synced 2026-01-11 23:02:55 +01:00
fix: showPopup replace error (#82)
Error: "TypeError: Cannot read properties of undefined (reading 'replace')"
This commit is contained in:
@@ -2,12 +2,18 @@ const { RouterHandler } = require('../nodes/navigation/router-handler');
|
||||
const NoodlRuntime = require('@noodl/runtime');
|
||||
|
||||
const navigation = {
|
||||
/**
|
||||
* This is set by "packages/noodl-viewer-react/src/noodl-js-api.js"
|
||||
* @type {NoodlRuntime}
|
||||
*/
|
||||
_noodlRuntime: undefined,
|
||||
|
||||
async showPopup(componentPath, params) {
|
||||
return new Promise((resolve) => {
|
||||
navigation._noodlRuntime.context.showPopup(componentPath, params, {
|
||||
onClosePopup: (action, results) => {
|
||||
resolve({
|
||||
action: action.replace('closeAction-', ''),
|
||||
action: action?.replace('closeAction-', ''),
|
||||
parameters: results
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user