Skip to content

Commit

Permalink
Update to newest wasp version
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr-Electron authored Jul 4, 2024
1 parent 2b0e8ea commit f9fb64d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
10 changes: 4 additions & 6 deletions config/versionedConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
},
],
},
Expand Down Expand Up @@ -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'],
},
],
},
Expand Down
7 changes: 4 additions & 3 deletions src/utils/pluginConfigGenerators.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 3 additions & 1 deletion src/utils/useSwitcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit f9fb64d

Please sign in to comment.