Skip to content

Commit

Permalink
Force a fresh search for updates for the notifier
Browse files Browse the repository at this point in the history
Closes #5546
  • Loading branch information
dtdesign committed Aug 14, 2023
1 parent 8b3c2fc commit 490ef42
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
11 changes: 9 additions & 2 deletions wcfsetup/install/files/acp/js/WCF.ACP.js
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,14 @@ WCF.ACP.Package.Update.Search = Class.extend({
}

this._button = elBySel('.jsButtonSearchForUpdates');
if (this._button) this._button.addEventListener('click', this._click.bind(this));
if (this._button) {
this._button.addEventListener('click', this._click.bind(this));

const url = new URL(window.location.href);
if (url.searchParams.has("searchForUpdates")) {
this._click();
}
}
},

/**
Expand All @@ -831,7 +838,7 @@ WCF.ACP.Package.Update.Search = Class.extend({
* @param {Event} event
*/
_click: function(event) {
event.preventDefault();
event?.preventDefault();

if (this._button.classList.contains('disabled')) {
return;
Expand Down
6 changes: 6 additions & 0 deletions wcfsetup/install/files/acp/style/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,12 @@ html[data-color-scheme="dark"] {
.pageHeaderPanel fa-icon[size="32"] {
display: none;
}

#outstandingUpdatesNotification .badgeUpdate {
left: 29px;
top: -4px;
padding: 0 4px;
}
}

@include screen-md-down {
Expand Down
4 changes: 2 additions & 2 deletions wcfsetup/install/files/acp/templates/pageHeaderUser.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
</li>

{if $__wcf->session->getPermission('admin.configuration.package.canUpdatePackage') && $__wcf->getAvailableUpdates()}
<li>
<a href="{link controller='PackageUpdate'}{/link}" class="jsTooltip" title="{lang}wcf.acp.package.updates{/lang}">
<li id="outstandingUpdatesNotification">
<a href="{link controller='PackageList' searchForUpdates=true}{/link}" class="jsTooltip" title="{lang}wcf.acp.package.updates{/lang}">
{icon size=16 name='arrows-rotate'}
{icon size=32 name='arrows-rotate'}
<span class="badge badgeUpdate">{#$__wcf->getAvailableUpdates()}</span>
Expand Down

0 comments on commit 490ef42

Please sign in to comment.