# What mistake have I made!?

**URL:** <https://forums.creativeclouddeveloper.com/t/what-mistake-have-i-made/6856>\
**Category:** Photoshop\
**Created:** [September 21, 2023, 1:26pm UTC](https://forums.creativeclouddeveloper.com/t/what-mistake-have-i-made/6856 "2023-09-21T13:26:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohamad](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/mohamad/32/2334_2.png) [@Mohamad](https://forums.creativeclouddeveloper.com/u/Mohamad)\
**Post date:** [September 21, 2023, 1:26pm UTC](https://forums.creativeclouddeveloper.com/t/what-mistake-have-i-made/6856/1 "2023-09-21T13:26:53Z")

</div>

Welcome all my friends.  
I’m having a little problem, which is that I want to show Dialog and make a functional choice  
Then I want Dialog to reappear automatically after the command is executed to complete something for example.  
This is my code:

```auto
const ImportDialog = async (callback) => {
    const res = await document.querySelector("#ImportDialog").uxpShowModal({
        title: "RETOUCHPRO 5 UXP",
        resize: "both", // "horizontal", "vertical", "none"
        size: {
            width: 250,
            height: 250
        }
    })
    console.log(`The dialog closed with: ${res}`)
    if (typeof callback === 'function') {
        callback(res);
    }
    const dialogCallback = (dialogResponse) => {
        console.log(dialogResponse);
        // do whatever with that response
        let color = document.querySelector("#Export").value;
        if (!color) {
            Export();
            return;
        } else if (color == "me") {
            await suspendHistory("openFiles", openFiles); //WORK...
        } else if (color == "me1") {
            await suspendHistory("openImge", openImge); //WORK...
        }
    }
}

```

When the code is executed, the panel freezes  
When deleted, the panel returns to work again.

With regards … 🙏  
Mohamed Fathi… 🍷

---

<div class="post-metadata">

**Author:** ![Karmalakas](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/karmalakas/32/1048_2.png) [@Karmalakas](https://forums.creativeclouddeveloper.com/u/Karmalakas)\
**Post date:** [September 25, 2023, 9:46am UTC](https://forums.creativeclouddeveloper.com/t/what-mistake-have-i-made/6856/2 "2023-09-25T09:46:54Z")

</div>

Did you try to debug line by line and see what freezes your panel?

---

<div class="post-metadata">

**Author:** ![Mohamad](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/mohamad/32/2334_2.png) [@Mohamad](https://forums.creativeclouddeveloper.com/u/Mohamad)\
**Post date:** [September 25, 2023, 11:26am UTC](https://forums.creativeclouddeveloper.com/t/what-mistake-have-i-made/6856/3 "2023-09-25T11:26:10Z")

</div>

I try and share the results here 🙂
