admin/plugins/updates: mark downgrades
Massimo Melina committed
Jun 29, 2024 at 15:40 UTC
e8af7debebe209ede781abe3a1dbc20f0c700e50
2 files changed
+3
admin/src/InstalledPlugins.ts
+1
@@ -138,6 +138,7 @@ export default function InstalledPlugins({ updates }: { updates?: true }) {
138
export function renderName({ row, value }: any) {
139
const { repo } = row
140
return h(Fragment, {},
141
+ row.downgrade && errorIcon("This version is older than the one you installed. It is possible that the author found a problem with your version and decided to retire it.", true),
142
errorIcon(row.error || row.badApi, !row.error),
143
repo?.includes('//') ? h(Link, { href: repo, target: 'plugin' }, value)
144
: !repo ? value
src/api.plugins.ts
+2
@@ -42,6 +42,8 @@ const apis: ApiHandlers = {
42
if (online.version !== disk.version) { // not just newer one, in case a version was retired
43
online.id = disk.id // id is installation-dependant, and online cannot know
44
online.repo = serialize(disk).repo // show the user the current repo we are getting this update from, not a possibly-changed future one
45
+ if (online.version! < disk.version)
46
+ (online as any).downgrade = true
47
list.add(online)
48
}
49
} catch (err: any) {