Skip to content

Commit

Permalink
fix: do not show outdated status if we have a new field
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip Jonas Ullrich committed Oct 31, 2019
1 parent fc5de3b commit 8cdf69c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion classes/Webhooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,6 @@ public static function getState(string $hookName): array
$cache = $kirby->cache('pju.webhooks');
$state = $cache->get($hookName);

return $state ? $state : ['status' => 'new', 'updated' => 0];
return $state ? $state : ['status' => 'new', 'updated' => null];
}
}
8 changes: 7 additions & 1 deletion src/components/WebhooksField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,13 @@ export default {
return ['hooksEmpty', 'hookNotfound', 'hookNoUrl'].includes(this.status);
},
status() {
return (this.hook.showOutdated && this.siteModifiedLive > this.hookUpdatedLive) ? 'outdated' : this.statusLive
return (
this.hook.showOutdated
&& !(this.statusLive === 'new')
&& this.siteModifiedLive > this.hookUpdatedLive
)
? 'outdated'
: this.statusLive
}
},
methods: {
Expand Down

0 comments on commit 8cdf69c

Please sign in to comment.