File tree Expand file tree Collapse file tree 3 files changed +16
-19
lines changed
src/dashboard/Data/Browser Expand file tree Collapse file tree 3 files changed +16
-19
lines changed Original file line number Diff line number Diff line change @@ -246,15 +246,12 @@ class Browser extends DashboardView {
246
246
}
247
247
248
248
async login ( username , password ) {
249
- if ( ! ! Parse . User . current ( ) ) {
249
+ if ( Parse . User . current ( ) ) {
250
250
Parse . User . logOut ( ) ;
251
251
}
252
- try {
253
- const currentUser = await Parse . User . logIn ( username , password ) ;
254
- this . setState ( { currentUser : currentUser , useMasterKey : false } , ( ) => this . refresh ( ) ) ;
255
- } catch ( error ) {
256
- throw error ;
257
- }
252
+
253
+ const currentUser = await Parse . User . logIn ( username , password ) ;
254
+ this . setState ( { currentUser : currentUser , useMasterKey : false } , ( ) => this . refresh ( ) ) ;
258
255
}
259
256
260
257
async logout ( ) {
Original file line number Diff line number Diff line change @@ -272,7 +272,7 @@ let BrowserToolbar = ({
272
272
< Separator />
273
273
< MenuItem text = { currentUser ? 'Switch Parse.User' : 'Browse as Parse.User' } onClick = { showLogin } active = { ! ! currentUser } />
274
274
{ currentUser ? < MenuItem text = { useMasterKey ? < span > Browsing with < b > Master Key</ b > </ span > : < span > Browse with < s > Master Key</ s > </ span > } onClick = { toggleMasterKeyUsage } active = { ! ! currentUser } greenActive = { useMasterKey } /> : < noscript /> }
275
- { currentUser ? < MenuItem text = { < span > Logout (< b > { currentUser . get ( " username" ) } </ b > )</ span > } onClick = { logout } active = { ! ! currentUser } /> : < noscript /> }
275
+ { currentUser ? < MenuItem text = { < span > Logout (< b > { currentUser . get ( ' username' ) } </ b > )</ span > } onClick = { logout } active = { ! ! currentUser } /> : < noscript /> }
276
276
</ BrowserMenu >
277
277
) : (
278
278
< noscript />
Original file line number Diff line number Diff line change 1
- import React from " react" ;
2
- import ParseApp from " lib/ParseApp" ;
3
- import PropTypes from " prop-types" ;
4
- import Modal from " components/Modal/Modal.react" ;
5
- import LoginRow from " components/LoginRow/LoginRow.react" ;
6
- import Notification from " dashboard/Data/Browser/Notification.react" ;
1
+ import React from ' react' ;
2
+ import ParseApp from ' lib/ParseApp' ;
3
+ import PropTypes from ' prop-types' ;
4
+ import Modal from ' components/Modal/Modal.react' ;
5
+ import LoginRow from ' components/LoginRow/LoginRow.react' ;
6
+ import Notification from ' dashboard/Data/Browser/Notification.react' ;
7
7
8
8
export default class LoginDialog extends React . Component {
9
9
constructor ( props ) {
10
10
super ( props ) ;
11
11
this . state = {
12
12
open : false ,
13
- username : "" ,
14
- password : ""
13
+ username : '' ,
14
+ password : ''
15
15
} ;
16
16
17
17
this . handleOpen = this . handleOpen . bind ( this ) ;
@@ -61,12 +61,12 @@ export default class LoginDialog extends React.Component {
61
61
open && (
62
62
< Modal
63
63
type = { Modal . Types . INFO }
64
- title = { currentUser ? " Switch Parse.User" : " Login as Parse.User" }
64
+ title = { currentUser ? ' Switch Parse.User' : ' Login as Parse.User' }
65
65
subtitle = {
66
- < div style = { { paddingTop : " 5px" } } >
66
+ < div style = { { paddingTop : ' 5px' } } >
67
67
{ currentUser && (
68
68
< p >
69
- Logged in as < strong > { currentUser . get ( " username" ) } </ strong >
69
+ Logged in as < strong > { currentUser . get ( ' username' ) } </ strong >
70
70
</ p >
71
71
) }
72
72
</ div >
You can’t perform that action at this time.
0 commit comments