Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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