Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
jackkav committed Sep 27, 2024
1 parent c2c0837 commit d50bae2
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions packages/insomnia/src/ui/components/environment-picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ export const EnvironmentPicker = ({

return match;
}}
onSelectionChange={environmentId => {
if (environmentId === 'all' || environmentId === null) {
onSelectionChange={key => {
if (key === 'all' || !key) {
return;
}

setActiveGlobalEnvironmentFetcher.submit(
{
environmentId,
environmentId: key.toString(),
},
{
method: 'POST',
Expand Down Expand Up @@ -168,15 +168,11 @@ export const EnvironmentPicker = ({
key={activeGlobalEnvironment?._id}
items={globalEnvironmentList}
selectedKeys={[activeGlobalEnvironment?._id || activeGlobalBaseEnvironment?._id || '']}
onSelectionChange={selection => {
if (selection === 'all' || selection === null) {
return;
}
const environmentId = selection.values().next().value;

if (environmentId === null) {
onSelectionChange={keys => {
if (keys === 'all' || !keys) {
return;
}
const [environmentId] = keys.values();

setActiveGlobalEnvironmentFetcher.submit(
{
Expand Down

0 comments on commit d50bae2

Please sign in to comment.