diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2018-11-12 20:28:04 +0300 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2018-11-12 20:37:50 +0300 |
commit | 52a2bc805ae86f9528ad6e0649a20de1185793af (patch) | |
tree | f04ccf84c7dd799e5aeeda880eb951e32f97d148 /js | |
parent | 0569aefa82cf06ef9d842126c491c71d5927b89e (diff) |
OCA.Settings might not yet be set. Check, and retry later.
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'js')
-rw-r--r-- | js/impersonate.js | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/js/impersonate.js b/js/impersonate.js index 13974f7..8e13817 100644 --- a/js/impersonate.js +++ b/js/impersonate.js @@ -27,7 +27,22 @@ ); } - OCA.Settings.UserList.registerAction('icon-user', t('impersonate', 'Impersonate'), impersonateDialog); + let registerFunction = function (delay) { + if(OCA.Settings === undefined) { + delay = delay * 2; + if(delay === 0) { + delay = 15; + } + if(delay > 500) { + console.warn("Could not register impersonate script"); + return; + } + setTimeout(function() {registerFunction(delay)}, delay); + } else { + OCA.Settings.UserList.registerAction('icon-user', t('impersonate', 'Impersonate'), impersonateDialog) + } + }; + registerFunction(0); }); })(OC, $); |