Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #227, Switch stubs error #228

Merged
merged 2 commits into from
Jun 22, 2024

Conversation

wtakuo
Copy link
Contributor

@wtakuo wtakuo commented Jun 21, 2024

In the class Activator method activate, the conditional expression was omitted so that the variable versions is always a list with elements of the form "key - value".

(Hi! 👋 Thanks for sending a pull request! Please make sure you click the link above to view the contribution guidelines, then fill out the blanks below.)

What does this implement/fix? Explain your changes.

Perhaps the cause of issue #227 is that in the following code (activator.mts, lines 1121-1130), the value of Object.keys( availableStubVersions).length is always 1 because the type of availableStubVersions is {[key: string]: string[]}.

          Object.entries(availableStubVersions).forEach(([key, values]) => {
            // Map each value to "key - value" and push to resultArray
            versions.push(
              ...values.map(value =>
                Object.keys(availableStubVersions).length > 1
                  ? `${stubPortToDisplayString(key)} - ${value}`
                  : value
              )
            );
          });

The following is the change in this pull-request.
This makes variable versions always a list with elements of the form "key - value".

          Object.entries(availableStubVersions).forEach(([key, values]) => {
            // Map each value to "key - value" and push to resultArray
            versions.push(
              ...values.map(value =>
                `${stubPortToDisplayString(key)} - ${value}`
              )
            );
          });

Does this close any currently open issues?

#227

Any relevant logs, error output, etc?

(If it’s long, please paste to https://gist.github.com and insert the link here)

Can be found in #227

Any other comments?

Where has this been tested?

Version: 1.90.2 (Universal)
Commit: 5437499feb04f7a586f677b155b039bc2b3669eb
Date: 2024-06-18T22:37:41.291Z
Electron: 29.4.0
ElectronBuildId: 9728852
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Darwin arm64 23.5.0

wtakuo and others added 2 commits June 22, 2024 00:42
In the class Activator method activate, the conditional expression was omitted so that the variable versions is always a list with elements of the form "key - value".
@paulober
Copy link
Owner

I just added a little extension to retain the UI text reduction.
But thanks again for taking the time to setup the dev env and creating this PR.

@paulober paulober changed the base branch from main to develop June 22, 2024 00:54
@paulober paulober merged commit 0f2d3e2 into paulober:develop Jun 22, 2024
4 checks passed
@paulober paulober mentioned this pull request Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants