Skip to content

Commit

Permalink
Fixed QA issue
Browse files Browse the repository at this point in the history
  • Loading branch information
elsoazemelet committed Apr 22, 2024
1 parent 98b65d0 commit 41c798a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/renderer/main/grid-layout/grid-modules/Device.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script>
import { runtime } from "./../../../runtime/runtime.store.js";
import { Analytics } from "./../../../runtime/analytics.js";
import {
contextMenu,
Expand Down Expand Up @@ -252,7 +253,17 @@
text: "Overwrite Element",
handler: () => handleOverwriteElement(elementNumber),
isDisabled: () => {
return typeof $controlElementClipboard === "undefined";
const clipboard = $controlElementClipboard;
const current = ConfigTarget.getCurrent();
let overwriteElementEnabled = false;
if (
typeof clipboard !== "undefined" &&
typeof current !== "undefined"
) {
overwriteElementEnabled =
current.elementType === clipboard.elementType;
}
return overwriteElementEnabled;
},
},
{
Expand Down

0 comments on commit 41c798a

Please sign in to comment.