]> source.dussan.org Git - nextcloud-server.git/commit
Fix default timeouts in OC.Notification
authorDaniel Calviño Sánchez <danxuliu@gmail.com>
Fri, 26 Jul 2019 16:00:07 +0000 (18:00 +0200)
committerDaniel Calviño Sánchez <danxuliu@gmail.com>
Fri, 26 Jul 2019 16:46:59 +0000 (18:46 +0200)
commit03f2e8a10e7c900b7a66683798309010a9428b16
tree5d0712b5be99cb50d1035b3bc10c8fe27a70b1ef
parent14006b548ec76a351c2adfeb27cc2aebaf8cf7dc
Fix default timeouts in OC.Notification

When no timeout was given "show()" used the default timeout of
"OCP.Toast", which is 7 seconds instead of indefinitely as stated in the
documentation of "show()". "showHtml()" should also indefinitely show
the notification if no timeout is given, but due to the strict
comparison the notification was indefinitely shown only when a timeout
of 0 was explicitly given. Now both methods show the notification
indefinitely (or until it is explicitly hidden) when no timeout is
given.

The unit tests did not catch this error because "showHtml()" had no
tests (as before the move to Toastify it was called from "show()" and
thus implicitly tested), and because "show()" verified that "hide()" was
not called after some time; "hide()" is no longer called from "show()"
since "OCP.Toast" is used internally, so the test always passed even if
the notification was indeed hidden. Now the test is based on whether the
element is found or not, and explicit tests were added too for
"showHtml()".

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
core/js/dist/login.js
core/js/dist/login.js.map
core/js/dist/main.js
core/js/dist/main.js.map
core/js/dist/maintenance.js
core/js/dist/maintenance.js.map
core/js/tests/specs/coreSpec.js
core/src/OC/notification.js