Skip to content

Commit

Permalink
Merge branch 'main' into sorgh/4327
Browse files Browse the repository at this point in the history
  • Loading branch information
hatpick authored Oct 6, 2020
2 parents dbf42da + b307bfe commit 82cf64a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Composer/packages/client/src/recoilModel/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

export * from './atoms';
export * from './DispatcherWrapper';
export * from './selectors/';
export * from './selectors';
15 changes: 15 additions & 0 deletions Composer/packages/client/src/recoilModel/selectors/extensions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import { selector } from 'recoil';

import { extensionsState } from '../atoms/appState';

export const enabledExtensionsSelector = selector({
key: 'enabledExtensionsSelector',
get: ({ get }) => {
const extensions = get(extensionsState);

return extensions.filter((e) => e.enabled);
},
});
7 changes: 4 additions & 3 deletions Composer/packages/client/src/recoilModel/selectors/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

export * from '../selectors/eject';
export * from '../selectors/design';
export * from '../selectors/validatedDialogs';
export * from './design';
export * from './eject';
export * from './extensions';
export * from './validatedDialogs';
4 changes: 2 additions & 2 deletions Composer/packages/client/src/utils/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import find from 'lodash/find';
import { useRecoilValue } from 'recoil';

import { ExtensionPageContribution } from '../recoilModel/types';
import { designPageLocationState, enabledExtensionsSelector, currentProjectIdState } from '../recoilModel';

import { designPageLocationState, extensionsState, currentProjectIdState } from './../recoilModel';
import { bottomLinks, topLinks } from './pageLinks';
import routerCache from './routerCache';
import { projectIdCache } from './projectCache';
Expand All @@ -26,7 +26,7 @@ export const useLocation = () => {
export const useLinks = () => {
const projectId = useRecoilValue(currentProjectIdState);
const designPageLocation = useRecoilValue(designPageLocationState(projectId));
const extensions = useRecoilValue(extensionsState);
const extensions = useRecoilValue(enabledExtensionsSelector);
const openedDialogId = designPageLocation.dialogId || 'Main';

// add page-contributing extensions
Expand Down

0 comments on commit 82cf64a

Please sign in to comment.