File tree 3 files changed +19
-11
lines changed
3 files changed +19
-11
lines changed Original file line number Diff line number Diff line change @@ -73,10 +73,12 @@ export const CommentsList = ({
73
73
}
74
74
75
75
setTimeout ( ( ) => {
76
- const { top, bottom } = topOffsetRef . current ?. getBoundingClientRect ( ) ;
76
+ if ( topOffsetRef . current ?. getBoundingClientRect ( ) ) {
77
+ const { top, bottom } = topOffsetRef . current . getBoundingClientRect ( ) ;
77
78
78
- setPopperTopOffset ( top ) ;
79
- setPopperBottomOffset ( bottom ) ;
79
+ setPopperTopOffset ( top ) ;
80
+ setPopperBottomOffset ( bottom ) ;
81
+ }
80
82
} ) ;
81
83
82
84
// HACK: Prevents UI flicker when popper renders and is temporarily out of bounds
Original file line number Diff line number Diff line change @@ -46,14 +46,19 @@ export default connect((state) => {
46
46
return ;
47
47
}
48
48
49
- props . dispatch ( fetchInstance ( ) ) . then ( ( res ) => {
50
- if ( res . status !== 200 ) {
51
- setError ( "You do not have permission to access this instance" ) ;
52
- } else {
53
- document . title = `Manager - ${ res . data ?. name } - Zesty` ;
54
- CONFIG . URL_PREVIEW_FULL = `${ CONFIG . URL_PREVIEW_PROTOCOL } ${ res . data ?. randomHashID } ${ CONFIG . URL_PREVIEW } ` ;
55
- }
56
- } ) ;
49
+ props
50
+ . dispatch ( fetchInstance ( ) )
51
+ . then ( ( res ) => {
52
+ if ( res . status !== 200 ) {
53
+ setError ( "You do not have permission to access this instance" ) ;
54
+ } else {
55
+ document . title = `Manager - ${ res . data ?. name } - Zesty` ;
56
+ CONFIG . URL_PREVIEW_FULL = `${ CONFIG . URL_PREVIEW_PROTOCOL } ${ res . data ?. randomHashID } ${ CONFIG . URL_PREVIEW } ` ;
57
+ }
58
+ } )
59
+ . catch ( ( ) => {
60
+ setError ( "Failed to load instance" ) ;
61
+ } ) ;
57
62
58
63
Promise . all ( [
59
64
props . dispatch ( fetchUser ( props . user . ZUID ) ) ,
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ export function fetchInstance() {
46
46
} )
47
47
. catch ( ( err ) => {
48
48
console . error ( "fetchInstance failed:" , err ) ;
49
+ return Promise . reject ( err ) ;
49
50
} ) ;
50
51
} ;
51
52
}
You can’t perform that action at this time.
0 commit comments