fix: possible installation failure in case of auto-check-updates #1086

Massimo Melina committed Sep 18, 2025 at 23:32 UTC 18c2be9dd7c207a9dfa557580a7dbf973dd03675
1 file changed +4 -3
admin/src/HomePage.ts
+4 -3
@@ -109,7 +109,8 @@ export default function HomePage() {
109 h('li',{}, `disable "admin access for localhost" in HFS (safe, but you won't see users' IPs)`),
110 )),
111 entry('', wikiLink('', "See the documentation"), " and ", h(Link, { target: 'support', href: REPO_URL + 'discussions' }, "get support")),
112 - !updates && with_(status.autoCheckUpdateResult, x => x?.isNewer && h(Update, { info: x, bodyCollapsed: true, title: "An update has been found" })),
112 + !updates && with_(status.autoCheckUpdateResult, x =>
113 + x?.isNewer && h(Update, { info: x, fromAuto: true, bodyCollapsed: true, title: "An update has been found" }) ),
114 pluginUpdates.length > 0 && entry('success', "Updates available for plugin(s): " + pluginUpdates.map(p => p.id).join(', ')),
115 h(ConfigForm, {
116 gridProps: { sx: { mt: 1, display: 'flex', columnGap: 1, alignitems: 'center', '&>div.MuiGrid2-root': { width: 'auto', px: .5, py: 0 }, '.MuiCheckbox-root': { pl: '2px' } } },
@@ -164,7 +165,7 @@ export default function HomePage() {
165 }
166 }
167
167 -function Update({ info, title, bodyCollapsed }: { title?: ReactNode, info: Release, bodyCollapsed?: boolean }) {
168 +function Update({ info, title, bodyCollapsed, fromAuto }: { title?: ReactNode, info: Release, bodyCollapsed?: boolean, fromAuto?: true }) {
169 const [collapsed, setCollapsed] = useState(bodyCollapsed)
170 return h(Flex, { alignItems: 'flex-start', flexWrap: 'wrap' },
171 h(Card, { className: 'release' }, h(CardContent, {},
@@ -173,7 +174,7 @@ function Update({ info, title, bodyCollapsed }: { title?: ReactNode, info: Relea
174 h(Btn, {
175 icon: UpdateIcon,
176 ...!info.isNewer && info.prerelease && { color: 'warning', variant: 'outlined' },
176 - onClick: () => update(info.tag_name)
177 + onClick: () => update(fromAuto ? undefined : info.tag_name) // in case of autoCheck, don't specify the tag_name, as it may have been retired in the meantime (in favor of a newer one)
178 }, prefix("Install ", info.name, info.isNewer ? '' : " (older)")),
179 h(Link, { href: REPO_URL + 'releases/tag/' + info.tag_name, target: 'repo' }, h(OpenInNew)),
180 ),