Feedback: Do now show dialog if welcome is present

- Do not bother user with multiple dialog at the loading time
- Add additional timer after the welcome dialog is closed before
calling feedback again

Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
Change-Id: Ib432e13205b1b3bef4dfa7ed8752a6561a4f0466
This commit is contained in:
Pedro Pinto Silva 2021-07-27 11:38:54 +02:00 committed by pedropintosilva
parent 07bb8dbad6
commit 503c801eb2

View file

@ -26,10 +26,14 @@ L.Map.Feedback = L.Handler.extend({
onFeedback: function () {
if (window.localStorage.getItem('WSDFeedbackEnabled')) {
if (this._iframeDialog && this._iframeDialog.hasLoaded())
this._iframeDialog.remove();
if (this._map.shouldWelcome())
setTimeout(L.bind(this.onFeedback, this), 3000);
else {
if (this._iframeDialog && this._iframeDialog.hasLoaded())
this._iframeDialog.remove();
this._iframeDialog = L.iframeDialog(window.feebackLocation);
this._iframeDialog = L.iframeDialog(window.feebackLocation);
}
}
},