Skip to content

Commit

Permalink
Stop notifying updates which have an older semver release.
Browse files Browse the repository at this point in the history
  • Loading branch information
RodoMa92 committed Mar 14, 2024
1 parent 4a7e9a5 commit eed486f
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 2 deletions.
4 changes: 3 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
"react-i18next": "^12.3.1",
"react-icons": "^4.9.0",
"react-markdown": "^8.0.7",
"remark-gfm": "^3.0.1"
"remark-gfm": "^3.0.1",
"compare-versions": "^6.1.0",
"semver": "^7.6.0"
}
}
29 changes: 29 additions & 0 deletions frontend/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion frontend/src/store.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { compare } from 'compare-versions';

import { InstallType, Plugin } from './plugin';
import { getSetting, setSetting } from './utils/settings';

Expand Down Expand Up @@ -126,7 +128,15 @@ export async function checkForUpdates(plugins: Plugin[]): Promise<PluginUpdateMa
const updateMap = new Map<string, StorePluginVersion>();
for (let plugin of plugins) {
const remotePlugin = serverData?.find((x) => x.name == plugin.name);
if (remotePlugin && remotePlugin.versions?.length > 0 && plugin.version != remotePlugin?.versions?.[0]?.name) {
//FIXME: Ugly hack since plugin.version might be null during evaulation,
//so set the older version possible
const curVer = plugin.version ? plugin.version : '0.0';
if (
remotePlugin &&
remotePlugin.versions?.length > 0 &&
plugin.version != remotePlugin?.versions?.[0]?.name &&
compare(remotePlugin?.versions?.[0]?.name, curVer, '>')
) {
updateMap.set(plugin.name, remotePlugin.versions[0]);
}
}
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit eed486f

Please sign in to comment.