Skip to content

Commit

Permalink
#671 - Require login for PNG/Copy PNG actions
Browse files Browse the repository at this point in the history
  • Loading branch information
whimet committed Mar 2, 2024
1 parent 773195c commit 019d684
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/components/ContentWrap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,10 @@ export default class ContentWrap extends Component {
trackEvent('ui', 'paneHeaderDblClick', codeWrapParent.dataset.type);
}
async exportPngClickHandler(e) {
if(!window.user) {
this.props.onLogin();
return;
}
const png = await this.getPngBlob();
saveAs(png, 'zenuml.png');
trackEvent('ui', 'downloadPng');
Expand All @@ -429,6 +433,10 @@ export default class ContentWrap extends Component {
}

async copyImageClickHandler(e) {
if(!window.user) {
this.props.onLogin();
return;
}
if (!navigator.clipboard || !navigator.clipboard.write) {
this.showCopyErrorNotice();
trackEvent('ui', 'copyImageFailed1');
Expand Down

0 comments on commit 019d684

Please sign in to comment.