mirror of
https://github.com/irislib/iris-messenger.git
synced 2024-09-20 01:56:33 +00:00
explorer
This commit is contained in:
parent
e049153f7a
commit
acaf4f0d6b
@ -8,7 +8,7 @@ class ExplorerView extends Component {
|
||||
return html`
|
||||
<div class="main-view public-messages-view">
|
||||
<div class="centered-container">
|
||||
<${ExplorerNode} path=''/>
|
||||
<${ExplorerNode} user=${this.props.user} path=''/>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
@ -26,7 +26,7 @@ class ExplorerNode extends Component {
|
||||
getNode() {
|
||||
if (this.props.path) {
|
||||
const path = this.props.path.split('/');
|
||||
return path.reduce((sum, current) => sum.get(current), publicState);
|
||||
return path.reduce((sum, current) => (current && sum.get(current)) || sum, publicState);
|
||||
}
|
||||
return publicState.user(this.props.user);
|
||||
}
|
||||
@ -49,10 +49,11 @@ class ExplorerNode extends Component {
|
||||
${Object.keys(this.state.children).map(k => {
|
||||
const v = this.state.children[k];
|
||||
let s = v;
|
||||
if (v && typeof v === 'object') {
|
||||
console.log(v);
|
||||
if (v && v['_'] && typeof v === 'object') {
|
||||
const path = v['_']['#'];
|
||||
s = html`<${ExplorerNode} path=${path}/>`;
|
||||
} else {
|
||||
s = JSON.stringify(s);
|
||||
}
|
||||
return html`
|
||||
<li>
|
||||
|
Loading…
Reference in New Issue
Block a user