File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed
src/shopping_carts/farnell Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,7 @@ async function getCartIds(site): Promise<Array<string> | null> {
9494 console . log ( 'inputs is null:' , inputs == null )
9595 return inputs
9696 } ,
97+ { timeoutMs : 60_000 } ,
9798 ) . catch ( e => {
9899 // timed out?
99100 console . error ( 'getCartIds:' )
@@ -117,15 +118,18 @@ async function getCartIds(site): Promise<Array<string> | null> {
117118
118119function getStoreId ( site ) : Promise < string | null > {
119120 const url = `${ site } /webapp/wcs/stores/servlet/AjaxOrderItemDisplayView`
120- return waitFor ( async ( ) => {
121- const text = await fetchRetry ( url ) . then ( res => res . text ( ) )
122- console . log ( 'text' )
123- const doc = new DOMParser ( ) . parseFromString ( text , 'text/html' )
124- console . log ( 'doc' )
125- const elem = doc . getElementById ( 'storeId' ) as HTMLInputElement
126- console . log ( 'elem is null:' , elem == null )
127- return elem ?. value
128- } ) . catch ( e => {
121+ return waitFor (
122+ async ( ) => {
123+ const text = await fetchRetry ( url ) . then ( res => res . text ( ) )
124+ console . log ( 'text' )
125+ const doc = new DOMParser ( ) . parseFromString ( text , 'text/html' )
126+ console . log ( 'doc' )
127+ const elem = doc . getElementById ( 'storeId' ) as HTMLInputElement
128+ console . log ( 'elem is null:' , elem == null )
129+ return elem ?. value
130+ } ,
131+ { timeoutMs : 60_000 } ,
132+ ) . catch ( e => {
129133 // timed out?
130134 console . error ( 'getStoreId:' )
131135 console . error ( e )
You can’t perform that action at this time.
0 commit comments