leap: index unmanaged reosurces to '/home' path

This commit is contained in:
Matilde Park 2020-10-08 16:18:29 -04:00
parent 36126fd944
commit 54fcd38e3d
3 changed files with 6 additions and 3 deletions

View File

@ -37,7 +37,7 @@ const otherIndex = function() {
return other;
};
export default function index(associations, apps, currentGroup) {
export default function index(associations, apps, currentGroup, groups) {
// all metadata from all apps is indexed
// into subscriptions and landscape
const subscriptions = [];
@ -75,9 +75,11 @@ export default function index(associations, apps, currentGroup) {
landscape.push(obj);
} else {
const app = each.metadata.module || each['app-name'];
const group = (groups[each['group-path']]?.hidden)
? '/home' : each['group-path'];
const obj = result(
title,
`/~landscape${each['group-path']}/join/${app}${each['app-path']}`,
`/~landscape${group}/join/${app}${each['app-path']}`,
app.charAt(0).toUpperCase() + app.slice(1),
(associations?.contacts?.[each['group-path']]?.metadata?.title || null)
);

View File

@ -150,6 +150,7 @@ class App extends React.Component {
apps={state.launch}
api={this.api}
dark={state.dark}
groups={state.groups}
show={state.omniboxShown}
/>
</ErrorBoundary>

View File

@ -31,7 +31,7 @@ export class Omnibox extends Component {
const { pathname } = this.props.location;
const selectedGroup = pathname.startsWith('/~landscape/ship/') ? '/' + pathname.split('/').slice(2,5).join('/') : null;
this.setState({ index: index(this.props.associations, this.props.apps.tiles, selectedGroup) });
this.setState({ index: index(this.props.associations, this.props.apps.tiles, selectedGroup, this.props.groups) });
}
if (prevProps && (prevProps.apps !== this.props.apps) && (this.state.query === '')) {