File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -743,9 +743,6 @@ BookLibService.Borrow(id) {
743743 }
744744
745745 async saveCode ( key ) {
746- const imageBlob = await this . contentWrap . getPngBlob ( ) ;
747-
748- this . state . currentItem . imageBase64 = await blobToBase64 ( imageBlob ) ;
749746 this . state . currentItem . updatedOn = Date . now ( ) ;
750747 this . state . currentItem . layoutMode = this . state . currentLayoutMode ;
751748
@@ -769,7 +766,9 @@ BookLibService.Borrow(id) {
769766
770767 try {
771768 const result = await syncDiagram ( this . state . currentItem ) ;
772- this . state . currentItem . shareLink = getShareLink ( result ) ;
769+ if ( result ) {
770+ this . state . currentItem . shareLink = getShareLink ( result ) ;
771+ }
773772 } catch ( e ) {
774773 console . error ( e ) ;
775774 }
Original file line number Diff line number Diff line change 11import firebase from 'firebase/app' ;
22
33async function syncDiagram ( currentItem ) {
4+ if ( location . host === 'localhost:8080' ) {
5+ console . log ( '!! Skipping sync-diagram call in local environment' ) ;
6+ return ;
7+ }
8+
49 const { id, title, js, imageBase64 } = currentItem ;
510 if ( ! js || ! title || ! imageBase64 ) {
611 throw Error ( 'Cannot sync diagram because of missing data' ) ;
You can’t perform that action at this time.
0 commit comments