Skip to content

Virtual whiteboard for sketching hand-drawn like diagrams

Use existing helper to copy all state (#1098)

Kent Beckaa54364bd687
diff --git a/src/components/App.tsx b/src/components/App.tsx
index 0da9ece100..e805c58f5d 100644
--- a/src/components/App.tsx
+++ b/src/components/App.tsx
@@ -512,7 +512,7 @@ export class App extends React.Component<any, AppState> {
if (isWritableElement(event.target)) {
return;
}
- copyToAppClipboard(globalSceneState.getAllElements(), this.state);
+ this.copyAll();
const { elements: nextElements, appState } = deleteSelectedElements(
globalSceneState.getAllElements(),
this.state,
@@ -527,10 +527,11 @@ export class App extends React.Component<any, AppState> {
if (isWritableElement(event.target)) {
return;
}
- copyToAppClipboard(globalSceneState.getAllElements(), this.state);
+ this.copyAll();
event.preventDefault();
});
- private copyToAppClipboard = () => {
+
+ private copyAll = () => {
copyToAppClipboard(globalSceneState.getAllElements(), this.state);
};
@@ -2446,7 +2447,7 @@ export class App extends React.Component<any, AppState> {
options: [
navigator.clipboard && {
label: t("labels.copy"),
- action: this.copyToAppClipboard,
+ action: this.copyAll,
},
navigator.clipboard && {
label: t("labels.paste"),