diff options
author | Marius David Wieschollek <passwords.public@mdns.eu> | 2020-02-27 19:41:28 +0300 |
---|---|---|
committer | Marius David Wieschollek <passwords.public@mdns.eu> | 2020-02-27 19:41:28 +0300 |
commit | e2e00a196a469804a75839eb0619cc6b323bda83 (patch) | |
tree | 3b0d85e3d7175c850335550a909beb49ad5c684a /src/js/Services | |
parent | 66e5f31da665869a3e88856215895f6ea1f8e55e (diff) |
Added feedback for pasting passwords
Signed-off-by: Marius David Wieschollek <passwords.public@mdns.eu>
Diffstat (limited to 'src/js/Services')
-rw-r--r-- | src/js/Services/MessageService.js | 12 | ||||
-rw-r--r-- | src/js/Services/ToastService.js | 20 |
2 files changed, 18 insertions, 14 deletions
diff --git a/src/js/Services/MessageService.js b/src/js/Services/MessageService.js index 4e71532..12e5d18 100644 --- a/src/js/Services/MessageService.js +++ b/src/js/Services/MessageService.js @@ -162,15 +162,19 @@ class MessageService { } } - if(response) { + if(response && resolve) { let reply = this._createMessageFromJSON(response); - if(!reply) return; + if(!reply) { + resolve(null, message); + return; + } reply = await this._notifyConverters(reply); console.debug('reply.receive', reply); - if(resolve) resolve(reply, message); + + resolve(reply, message); } else { - console.debug('message.response', response, message); + console.debug('message.response', response, message, resolve); } } catch(error) { ErrorManager.logError(error, message); diff --git a/src/js/Services/ToastService.js b/src/js/Services/ToastService.js index b9b1c27..0a04fbb 100644 --- a/src/js/Services/ToastService.js +++ b/src/js/Services/ToastService.js @@ -43,8 +43,8 @@ class ToastService { /** * - * @param {String} message The text of the toast - * @param {String} [title=null] The title of the toast + * @param {(String|String[])} message The text of the toast + * @param {(String|String[])} [title=null] The title of the toast * @return {Promise<String>} */ warning(message, title = null) { @@ -54,8 +54,8 @@ class ToastService { /** * - * @param {String} message The text of the toast - * @param {String} [title=null] The title of the toast + * @param {(String|String[])} message The text of the toast + * @param {(String|String[])} [title=null] The title of the toast * @return {Promise<String>} */ error(message, title = null) { @@ -65,8 +65,8 @@ class ToastService { /** * await ToastService.info('text', 'title', {a: 'Option A', b: 'Option B'}); * - * @param {String} message The text of the toast - * @param {String} [title=null] The title of the toast + * @param {(String|String[])} message The text of the toast + * @param {(String|String[])} [title=null] The title of the toast * @param {Object} [options=null] Object with available buttons * @param {Number} [ttl=10] Time before the toast is closed * @return {Promise<String>} @@ -82,12 +82,12 @@ class ToastService { /** * - * @param {String} message The text of the toast - * @param {String} [title=null] The title of the toast + * @param {(String|String[])} message The text of the toast + * @param {(String|String[])} [title=null] The title of the toast * @return {Promise<String>} */ success(message, title = null) { - return this.create({type: 'success', title, message, closeable: true, ttl: 5}); + return this.create({type: 'success', title, message, closeable: true, ttl: 3}); } @@ -234,7 +234,7 @@ class ToastService { let queue = QueueService.getQueue('toasts', 'popup'); try { - let item = await queue.push(toast); + let item = await queue.push(toast); delete this._toasts[toast.getId()]; resolve(item.getResult()); } catch(e) { |