Skip to content

Commit

Permalink
Merge pull request #62 from medienhaus/search-service-in-applications
Browse files Browse the repository at this point in the history
Ensure service spaces are within applications folder
  • Loading branch information
fnwbr authored Sep 13, 2023
2 parents c2828cd + 664ba98 commit 71ee874
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/Matrix.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,11 @@ function useMatrixProvider(auth) {

useEffect(() => {
const lookForServiceSpaces = async () => {
// @TODO We do not actually ensure that the service spaces we search for are a child space of the
// "Applications" space we found previously. I assume we want to ensure that though.
const serviceSpaces = {};
for (const element of Object.keys(getConfig().publicRuntimeConfig.authProviders)) {
if (element === 'matrix') continue; // we don't want to create a service folder for matrix

const existingServiceSpace = Array.from(spaces.values()).find(space => space.name === element);
const applicationsChildren = spaces.get(applicationsFolder).children.map(child => spaces.get(child));
const existingServiceSpace = applicationsChildren.find(space => space.name === element);
if (existingServiceSpace) {
logger.debug('Found existing service space', { serviceType: element, existingServiceSpace });
serviceSpaces[element] = existingServiceSpace.roomId;
Expand Down

0 comments on commit 71ee874

Please sign in to comment.