File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -52,9 +52,11 @@ var Retool = /*#__PURE__*/function (_React$Component) {
5252 _this = _super . call ( this , props ) ;
5353
5454 _defineProperty ( _assertThisInitialized ( _this ) , "startListening" , function ( ) {
55- window . addEventListener ( 'message' , function ( e ) {
56- return _this . handle ( e ) ;
57- } ) ;
55+ if ( _this . iframe ) {
56+ window . addEventListener ( 'message' , function ( e ) {
57+ return _this . handle ( e ) ;
58+ } ) ;
59+ }
5860 } ) ;
5961
6062 _defineProperty ( _assertThisInitialized ( _this ) , "startWatchers" , function ( ) {
@@ -131,6 +133,7 @@ var Retool = /*#__PURE__*/function (_React$Component) {
131133 }
132134 } ) ;
133135
136+ if ( ! _this . props . url ) throw new Error ( 'Please pass a url into the Retool component.' ) ;
134137 _this . state = {
135138 url : props . url ,
136139 elementWatchers : { }
Original file line number Diff line number Diff line change 11{
22 "name" : " react-retool" ,
3- "version" : " 0.2.0 " ,
3+ "version" : " 0.2.1 " ,
44 "private" : false ,
55 "repository" : {
66 "type" : " git" ,
Original file line number Diff line number Diff line change 3838 "build" : " react-scripts build" ,
3939 "test" : " react-scripts test" ,
4040 "eject" : " react-scripts eject" ,
41- "publish:npm" : " rm -rf dst && mkdir dst && babel src/components -d dst --copy-files && mv ./dst/Retool.js ./dst/index.js && cp ./package.json ./dst/package.json"
41+ "publish:npm" : " rm -rf dst && mkdir dst && babel src/components -d dst --copy-files && mv ./dst/Retool.js ./dst/index.js && cp ./package.json ./dst/package.json && cp ./README.md ./dst/README.md "
4242 },
4343 "eslintConfig" : {
4444 "extends" : [
You can’t perform that action at this time.
0 commit comments