refactor update listener and reload browser window on update success

This commit is contained in:
Mohit Panjwani
2019-11-23 13:15:58 +05:30
parent 7fd1224502
commit 07601a7130
6 changed files with 10 additions and 6 deletions

View File

@ -12,10 +12,10 @@ class Listener
* @param $event
* @return boolean
*/
protected function check($event)
protected function isListenerFired($event)
{
// Do not apply to the same or newer versions
if (version_compare(static::VERSION, $event->old, '>')) {
if (version_compare(static::VERSION, $event->old, '<')) {
return true;
}

View File

@ -29,7 +29,7 @@ class Version110
*/
public function handle(UpdateFinished $event)
{
if (!$this->check($event)) {
if ($this->isListenerFired($event)) {
return;
}