File tree Expand file tree Collapse file tree 1 file changed +16
-13
lines changed Expand file tree Collapse file tree 1 file changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -399,22 +399,25 @@ function getChildren(folderId) {
399399 } ) ;
400400}
401401
402- async function refreshAllThumbnails ( ) {
403- //const allFolders = folders.concat(speedDialId);
402+ function refreshAllThumbnails ( ) {
404403 let urls = [ ] ;
405-
406- let children = await browser . bookmarks . getChildren ( currentFolder ) ;
407- for ( let child of children ) {
408- if ( child . url && ( child . url . startsWith ( 'https://' ) || child . url . startsWith ( 'http://' ) ) ) {
409- urls . push ( child . url ) ;
410- }
411- }
412-
404+
413405 hideModals ( ) ;
414406
415- tabMessagePort . postMessage ( { refreshAll : true , urls} ) ;
416- toastContent . innerText = ` Capturing images...` ;
417- toast . style . transform = "translateX(0%)" ;
407+ browser . bookmarks . getChildren ( currentFolder ) . then ( children => {
408+ if ( children && children . length ) {
409+ for ( let child of children ) {
410+ if ( child . url && ( child . url . startsWith ( 'https://' ) || child . url . startsWith ( 'http://' ) ) ) {
411+ urls . push ( child . url ) ;
412+ }
413+ }
414+ tabMessagePort . postMessage ( { refreshAll : true , urls} ) ;
415+ toastContent . innerText = ` Capturing images...` ;
416+ toast . style . transform = "translateX(0%)" ;
417+ }
418+ } ) . catch ( err => {
419+ console . log ( err ) ;
420+ } ) ;
418421}
419422
420423// assumes 'bookmarks' param is content of a folder (from getBookmarks)
You can’t perform that action at this time.
0 commit comments