Skip to content

Commit

Permalink
feat: Show the latest version of the plugin in the plugin's catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
PintoGideon committed May 3, 2024
1 parent c5bc96d commit 89dc8b4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/PluginCatalog/PluginCatalog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,15 @@ const PluginCatalog = () => {
const pluginList = await client.getPluginMetas(params);
const plugins: PluginMeta[] = pluginList.getItems() as PluginMeta[];
if (plugins) {
// Fetch all the versions of the plugins to display
const newPluginPayload = Promise.all(
plugins.map(async (plugin) => {
const plugins = await plugin.getPlugins({ limit: 1000 });
const pluginItems = plugins.getItems();
let version = "";

if (pluginItems) {
version = pluginItems[pluginItems.length - 1].data.version;
if (pluginItems && pluginItems.length > 0) {
version = pluginItems[0].data.version;
}
return {
data: {
Expand Down

0 comments on commit 89dc8b4

Please sign in to comment.