Skip to content

Commit 019d684

Browse files
committed
#671 - Require login for PNG/Copy PNG actions
1 parent 773195c commit 019d684

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/components/ContentWrap.jsx

+8
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,10 @@ export default class ContentWrap extends Component {
414414
trackEvent('ui', 'paneHeaderDblClick', codeWrapParent.dataset.type);
415415
}
416416
async exportPngClickHandler(e) {
417+
if(!window.user) {
418+
this.props.onLogin();
419+
return;
420+
}
417421
const png = await this.getPngBlob();
418422
saveAs(png, 'zenuml.png');
419423
trackEvent('ui', 'downloadPng');
@@ -429,6 +433,10 @@ export default class ContentWrap extends Component {
429433
}
430434

431435
async copyImageClickHandler(e) {
436+
if(!window.user) {
437+
this.props.onLogin();
438+
return;
439+
}
432440
if (!navigator.clipboard || !navigator.clipboard.write) {
433441
this.showCopyErrorNotice();
434442
trackEvent('ui', 'copyImageFailed1');

0 commit comments

Comments
 (0)