From 4e0f2ed0b7ef4f6dd83bfe4123fb0e9d0f1444d2 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Mon, 27 Feb 2023 18:08:25 +0100 Subject: [PATCH] fix unexpected parameter to callback The handler will receive an Event as first parameter, but the function expected an int value. Further calculcation of the delay was not working thus. Signed-off-by: Arthur Schiwon --- js/impersonate.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/impersonate.js b/js/impersonate.js index 7ea6459..bed6a61 100644 --- a/js/impersonate.js +++ b/js/impersonate.js @@ -30,7 +30,7 @@ ) } - var registerFunction = function(delay) { + var registerFunction = function(event, delay) { delay = delay || 0 if (OCA.Settings === undefined) { delay = delay * 2 @@ -41,7 +41,7 @@ console.error('Could not register impersonate script') return } - setTimeout(function() { registerFunction(delay) }, delay) + setTimeout(function() { registerFunction(event, delay) }, delay) } else { OCA.Settings.UserList.registerAction('icon-user', t('impersonate', 'Impersonate'), impersonateDialog) }