Skip to content

Commit 7c03411

Browse files
authored
Merge pull request #626 from ZenUml/fix-reload-issue
Fix reload different diagram issue by removing image blob generation in saveCode
2 parents f2dc7a5 + ede5378 commit 7c03411

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/components/app.jsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff 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
}

src/services/syncService.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import firebase from 'firebase/app';
22

33
async 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');

0 commit comments

Comments
 (0)