From 342764e9ff211eca2ef2fc7401f625aa99f1b4f2 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Thu, 26 Oct 2023 13:19:43 +0300 Subject: [PATCH] related records modal fetch when rendered --- client/src/views/modals/related-list.js | 12 +++++++++--- client/src/views/modals/select-records.js | 12 +++++++++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/client/src/views/modals/related-list.js b/client/src/views/modals/related-list.js index 0c343a334e..fda213c620 100644 --- a/client/src/views/modals/related-list.js +++ b/client/src/views/modals/related-list.js @@ -436,13 +436,19 @@ class RelatedListModalView extends ModalView { } const fetch = () => { - // Timeout to make notify work. - setTimeout(() => { + this.whenRendered().then(() => { Espo.Ui.notify(' ... '); this.collection.fetch() .then(() => Espo.Ui.notify(false)); - }, 1); + }); + // Timeout to make notify work. + /*setTimeout(() => { + Espo.Ui.notify(' ... '); + + this.collection.fetch() + .then(() => Espo.Ui.notify(false)); + }, 1);*/ }; if (this.options.forceSelectAllAttributes || this.forceSelectAllAttributes) { diff --git a/client/src/views/modals/select-records.js b/client/src/views/modals/select-records.js index 15c28815b9..d2dddc94ea 100644 --- a/client/src/views/modals/select-records.js +++ b/client/src/views/modals/select-records.js @@ -297,13 +297,19 @@ class SelectRecordsModalView extends ModalView { } const fetch = () => { - // Timeout to make notify work. - setTimeout(() => { + this.whenRendered().then(() => { Espo.Ui.notify(' ... '); this.collection.fetch() .then(() => Espo.Ui.notify(false)); - }, 1); + }); + // Timeout to make notify work. + /*setTimeout(() => { + Espo.Ui.notify(' ... '); + + this.collection.fetch() + .then(() => Espo.Ui.notify(false)); + }, 1);*/ }; if (this.options.forceSelectAllAttributes || this.forceSelectAllAttributes) {