File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed
govtool/frontend/src/context Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ changes.
8585- Fix usage of trim on missing label
8686- Fix blank screen when registering as a DRep [ Issue 2408] ( https://github.com/IntersectMBO/govtool/issues/2408 )
8787- Fix type mismatch between sql and haskell code for stake key address
88+ - Handle missing api key exception [ Issue 2683] ( https://github.com/IntersectMBO/govtool/issues/2683 )
8889
8990### Changed
9091
Original file line number Diff line number Diff line change @@ -73,11 +73,19 @@ export const UsersnapProvider = ({
7373 } , [ usersnapApi ] ) ;
7474
7575 useEffect ( ( ) => {
76- loadSpace ( API_KEY ) . then ( ( api ) => {
77- api . init ( initParams ) ;
78- setUsersnapApi ( api ) ;
79- } ) ;
80- } , [ initParams ] ) ;
76+ const initUsersnapSpace = async ( ) => {
77+ if ( API_KEY ) {
78+ try {
79+ const api = await loadSpace ( API_KEY ) ;
80+ api . init ( initParams ) ;
81+ setUsersnapApi ( api ) ;
82+ } catch ( error ) {
83+ console . error ( error ) ;
84+ }
85+ }
86+ } ;
87+ initUsersnapSpace ( ) ;
88+ } , [ initParams , API_KEY ] ) ;
8189
8290 const value = useMemo ( ( ) => ( { openFeedbackWindow } ) , [ openFeedbackWindow ] ) ;
8391
You can’t perform that action at this time.
0 commit comments