diff options
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/OC/notification.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/src/OC/notification.js b/core/src/OC/notification.js index 6207331150f..adac95f1d37 100644 --- a/core/src/OC/notification.js +++ b/core/src/OC/notification.js @@ -21,7 +21,7 @@ import _ from 'underscore' import $ from 'jquery' -import { showMessage } from '@nextcloud/dialogs' +import { showMessage, TOAST_DEFAULT_TIMEOUT, TOAST_PERMANENT_TIMEOUT } from '@nextcloud/dialogs' /** * @todo Write documentation @@ -98,7 +98,7 @@ export default { showHtml(html, options) { options = options || {} options.isHTML = true - options.timeout = (!options.timeout) ? -1 : options.timeout + options.timeout = (!options.timeout) ? TOAST_PERMANENT_TIMEOUT : options.timeout const toast = showMessage(html, options) toast.toastElement.toastify = toast return $(toast.toastElement) @@ -116,7 +116,7 @@ export default { */ show(text, options) { options = options || {} - options.timeout = (!options.timeout) ? -1 : options.timeout + options.timeout = (!options.timeout) ? TOAST_PERMANENT_TIMEOUT : options.timeout const toast = showMessage(text, options) toast.toastElement.toastify = toast return $(toast.toastElement) @@ -133,7 +133,7 @@ export default { if (this.updatableNotification) { this.updatableNotification.hideToast() } - this.updatableNotification = showMessage(text, { timeout: -1 }) + this.updatableNotification = showMessage(text, { timeout: TOAST_PERMANENT_TIMEOUT }) this.updatableNotification.toastElement.toastify = this.updatableNotification return $(this.updatableNotification.toastElement) }, @@ -152,7 +152,7 @@ export default { */ showTemporary(text, options) { options = options || {} - options.timeout = options.timeout || 7 + options.timeout = options.timeout || TOAST_DEFAULT_TIMEOUT const toast = showMessage(text, options) toast.toastElement.toastify = toast return $(toast.toastElement) |