Commit 4d5e161a authored by rdavis's avatar rdavis
Browse files

Updated Functions and Tools to use existing selected* Variable

Applied formatting
parent 263d4bf4
...@@ -41,9 +41,7 @@ ...@@ -41,9 +41,7 @@
let showValvesModal = false; let showValvesModal = false;
let selectedFunction = null; let selectedFunction = null;
let showDeleteConfirm = false; let showDeleteConfirm = false;
let deleteFunction = null;
const shareHandler = async (tool) => { const shareHandler = async (tool) => {
console.log(tool); console.log(tool);
...@@ -251,7 +249,7 @@ ...@@ -251,7 +249,7 @@
exportHandler(func); exportHandler(func);
}} }}
deleteHandler={async () => { deleteHandler={async () => {
deleteFunction = func; selectedFunction = func;
showDeleteConfirm = true; showDeleteConfirm = true;
}} }}
onClose={() => {}} onClose={() => {}}
...@@ -396,11 +394,11 @@ ...@@ -396,11 +394,11 @@
bind:show={showDeleteConfirm} bind:show={showDeleteConfirm}
title={$i18n.t('Delete function?')} title={$i18n.t('Delete function?')}
on:confirm={() => { on:confirm={() => {
deleteHandler(deleteFunction); deleteHandler(selectedFunction);
}} }}
> >
<div class=" text-sm text-gray-500"> <div class=" text-sm text-gray-500">
{$i18n.t('This will delete')} <span class=" font-semibold">{deleteFunction.name}</span>. {$i18n.t('This will delete')} <span class=" font-semibold">{selectedFunction.name}</span>.
</div> </div>
</DeleteConfirmDialog> </DeleteConfirmDialog>
......
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
let selectedTool = null; let selectedTool = null;
let showDeleteConfirm = false; let showDeleteConfirm = false;
let deleteTool = null;
const shareHandler = async (tool) => { const shareHandler = async (tool) => {
console.log(tool); console.log(tool);
...@@ -244,7 +243,7 @@ ...@@ -244,7 +243,7 @@
exportHandler(tool); exportHandler(tool);
}} }}
deleteHandler={async () => { deleteHandler={async () => {
deleteTool = tool; selectedTool = tool;
showDeleteConfirm = true; showDeleteConfirm = true;
}} }}
onClose={() => {}} onClose={() => {}}
...@@ -379,11 +378,11 @@ ...@@ -379,11 +378,11 @@
bind:show={showDeleteConfirm} bind:show={showDeleteConfirm}
title={$i18n.t('Delete tool?')} title={$i18n.t('Delete tool?')}
on:confirm={() => { on:confirm={() => {
deleteHandler(deleteTool); deleteHandler(selectedTool);
}} }}
> >
<div class=" text-sm text-gray-500"> <div class=" text-sm text-gray-500">
{$i18n.t('This will delete')} <span class=" font-semibold">{deleteTool.name}</span>. {$i18n.t('This will delete')} <span class=" font-semibold">{selectedTool.name}</span>.
</div> </div>
</DeleteConfirmDialog> </DeleteConfirmDialog>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment