File tree Expand file tree Collapse file tree 1 file changed +15
-10
lines changed
redisinsight/desktop/views/cloud_outh_callback Expand file tree Collapse file tree 1 file changed +15
-10
lines changed Original file line number Diff line number Diff line change 1
- const protocol = 'redisinsight://' ;
2
- const callbackUrl = 'cloud/oauth/callback' ;
1
+ const protocol = 'redisinsight://'
2
+ const callbackUrl = 'cloud/oauth/callback'
3
3
4
- const openAppButton = document . querySelector ( '#open-app' ) ;
4
+ const openAppButton = document . querySelector ( '#open-app' )
5
5
6
- const openApp = ( ) => {
6
+ const openApp = ( forceOpen ) => {
7
7
try {
8
- const currentUrl = new URL ( window . location . href ) ;
9
- const redirectUrl = protocol + callbackUrl + currentUrl . search ;
8
+ const currentUrl = new URL ( window . location . href )
9
+ const redirectUrl = protocol + callbackUrl + currentUrl . search
10
+ const isOpened = window . location . hash === '#success'
10
11
11
- window . location . href = redirectUrl . toString ( ) ;
12
+ if ( forceOpen || ! isOpened ) {
13
+ window . location . href = redirectUrl . toString ( )
14
+ }
15
+
16
+ window . location . hash = '#success'
12
17
} catch ( _e ) {
13
18
//
14
19
}
15
- } ;
20
+ }
16
21
17
22
// handlers
18
- openAppButton . addEventListener ( 'click' , openApp ) ;
23
+ openAppButton . addEventListener ( 'click' , ( ) => openApp ( true ) )
19
24
20
- openApp ( ) ;
25
+ openApp ( )
You can’t perform that action at this time.
0 commit comments