Skip to content

Commit

Permalink
single service mode closes #62
Browse files Browse the repository at this point in the history
  • Loading branch information
lexoyo committed Aug 24, 2018
1 parent 20815d5 commit 958e60e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions src/js/CloudExplorer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,15 @@ export default class CloudExplorer extends React.Component {
files,
loading: false
});
// the first display, single service mode, try to enter
// this is useful when CE is used by hosting companies to display the user files, and the user has logged in their system
if(!this.initDone && files.length === 1 && path.length === 0/* && files[0].isLoggedIn === true*/) {
this.unifile.cd([files[0].name], true)
.then(path => {
this.props.onCd(path);
});
}
this.initDone = true;
}
})
.catch((e) => this.onUnifileError(e));
Expand Down
4 changes: 2 additions & 2 deletions src/js/UnifileService.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ export default class UnifileService {
});
}

cd (path) {
cd (path, preventAuth=false) {
return new Promise((resolve, reject) => {
if (path.length === 1 && path[0] !== this.currentPath[0]) {
if (!preventAuth && path.length === 1 && path[0] !== this.currentPath[0]) {
this.auth(path[0])
.then(() => {
this.currentPath = path;
Expand Down

0 comments on commit 958e60e

Please sign in to comment.