mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 19:51:09 -04:00
refactor update listener and reload browser window on update success
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@ class Version110
|
||||
*/
|
||||
public function handle(UpdateFinished $event)
|
||||
{
|
||||
if (!$this->check($event)) {
|
||||
if ($this->isListenerFired($event)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user