Skip to content

Commit 3bd5ddc

Browse files
committed
replace isDialogOpen with a call to checkIsOpen
1 parent dfc3eeb commit 3bd5ddc

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

packages/feedback-async/src/widget/createWidget.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ export function createWidget({
4040
}: CreateWidgetParams): FeedbackWidget {
4141
let actor: ActorComponent | undefined;
4242
let dialog: DialogComponent | undefined;
43-
let isDialogOpen: boolean = false;
4443

4544
/**
4645
* Show the success message for 5 seconds
@@ -152,7 +151,7 @@ export function createWidget({
152151
try {
153152
if (dialog) {
154153
dialog.open();
155-
isDialogOpen = true;
154+
156155
if (options.onFormOpen) {
157156
options.onFormOpen();
158157
}
@@ -221,7 +220,6 @@ export function createWidget({
221220
function closeDialog(): void {
222221
if (dialog) {
223222
dialog.close();
224-
isDialogOpen = false;
225223

226224
if (options.onFormClose) {
227225
options.onFormClose();
@@ -245,8 +243,7 @@ export function createWidget({
245243
*
246244
*/
247245
function handleActorClick(): void {
248-
// Open dialog
249-
if (!isDialogOpen) {
246+
if (dialog && !dialog.checkIsOpen()) {
250247
openDialog();
251248
}
252249

0 commit comments

Comments
 (0)