From ddcb4e96e1f95b2a36c91bdc7ff95fcd7834c48a Mon Sep 17 00:00:00 2001 From: Akuoko Daniel Jnr Date: Tue, 8 Dec 2020 18:04:35 +0000 Subject: [PATCH] refactor: move props to guard code --- components/core/SlateMediaObject.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/core/SlateMediaObject.js b/components/core/SlateMediaObject.js index c56339e1..5cb02fb0 100644 --- a/components/core/SlateMediaObject.js +++ b/components/core/SlateMediaObject.js @@ -59,9 +59,7 @@ export default class SlateMediaObject extends React.Component { const url = this.props.data.url; const type = this.props.data.type ? this.props.data.type : "LEGACY_NO_TYPE"; const playType = typeMap[type] ? typeMap[type] : type; - const unityGameConfig = this.props.data.unityGameConfig; - const unityGameLoader = this.props.data.unityGameLoader; - console.log(this.props.data); + let element =
No Preview
; if (type.startsWith("application/pdf")) { @@ -96,6 +94,9 @@ export default class SlateMediaObject extends React.Component { // TODO(jim): We will need to revisit this later. if (type.startsWith("application/unity")) { + const unityGameConfig = this.props.data.unityGameConfig; + const unityGameLoader = this.props.data.unityGameLoader; + return ( );