From f9fb64d06f65c6a674bfca739373dae2907ea408 Mon Sep 17 00:00:00 2001 From: Dr-Electron Date: Thu, 4 Jul 2024 22:12:03 +0200 Subject: [PATCH] Update to newest wasp version --- config/versionedConfig.js | 10 ++++------ src/utils/pluginConfigGenerators.js | 7 ++++--- src/utils/useSwitcher.ts | 4 +++- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/config/versionedConfig.js b/config/versionedConfig.js index dce6937538b..744d29f0788 100644 --- a/config/versionedConfig.js +++ b/config/versionedConfig.js @@ -28,12 +28,11 @@ exports.buildPluginsConfig = [ versions: [ { label: 'v1.1', - badges: ['IOTA'], + banner: 'unmaintained', }, { label: 'v1.3', - badges: ['Shimmer', 'Testnet'], - banner: 'staging', + badges: ['IOTA', 'Shimmer', 'Testnet'], }, ], }, @@ -155,12 +154,11 @@ exports.maintainPluginsConfig = [ versions: [ { label: 'v1.1', - badges: ['IOTA'], + banner: 'unmaintained', }, { label: 'v1.3', - badges: ['Shimmer', 'Testnet'], - banner: 'staging', + badges: ['IOTA', 'Shimmer', 'Testnet'], }, ], }, diff --git a/src/utils/pluginConfigGenerators.js b/src/utils/pluginConfigGenerators.js index 4cd7f6769f3..511ff1227ca 100644 --- a/src/utils/pluginConfigGenerators.js +++ b/src/utils/pluginConfigGenerators.js @@ -4,17 +4,18 @@ const MAIN_BADGE = 'IOTA'; /** * Find main version of a plugin by resolving it to the first version with the corresponding batch. - * @param {import('../common/components/Switcher').Doc} plugin + * @param {import('../components/Switcher').Doc} plugin + * @param {string} badge */ function findMainVersion(plugin, badge = MAIN_BADGE) { return plugin.versions.find((version) => - version.badges.some((b) => b.includes(badge)), + version.badges ? version.badges.some((b) => b.includes(badge)) : false, ); } /** * Generate the plugin config from the versioned config. - * @param {import('../common/components/Switcher').Doc[]} pluginConfig + * @param {import('../components/Switcher').Doc[]} pluginConfig * @param {string} basePath */ function generatePluginConfig(pluginConfig, basePath) { diff --git a/src/utils/useSwitcher.ts b/src/utils/useSwitcher.ts index 0b459a5717b..0d99a373f09 100644 --- a/src/utils/useSwitcher.ts +++ b/src/utils/useSwitcher.ts @@ -137,7 +137,9 @@ export default function useSwitcher(): SwitcherProps { // Resolve the doc link to the first MAIN_BADGE version. let to = versionLinks[0].to; const foundVersion = versionLinks.find((version) => - version.badges.some((b) => b.includes(MAIN_BADGE)), + version.badges + ? version.badges.some((b) => b.includes(MAIN_BADGE)) + : false, ); if (foundVersion) to = foundVersion.to;