Opened 19 months ago
Closed 19 months ago
#62796 closed defect (bug) (reported-upstream)
Block Inserter: directory search: infinity spinner if offline
| Reported by: | Drivingralle | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Editor | Version: | 6.7.1 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
Description
If a user is offline or in playground the network access is blocked the search section of the block inserter is showing the spinner infinity.
Inside the browser console the request (https://playground.wordpress.net/scope:calm-trendy-town/wp-json/wp/v2/block-directory/search?term=slider&_locale=user) very quickly returns a 500. But the UI never reflects to it.
Similar to the section above it I was expecting an error message if the search fails.
Attachments (1)
Change History (4)
#2
@
19 months ago
- Keywords has-patch added
This is a fix that was to be made in Gutenberg for which I have raised a PR
https://github.com/WordPress/gutenberg/pull/68600
Attaching the patch here as well.
diff --git a/packages/block-directory/src/store/resolvers.js b/packages/block-directory/src/store/resolvers.js
index cd13ba5ccd..846ff9ef2b 100644
--- a/packages/block-directory/src/store/resolvers.js
+++ b/packages/block-directory/src/store/resolvers.js
@@ -35,5 +35,7 @@ export const getDownloadableBlocks =
);
dispatch( receiveDownloadableBlocks( blocks, filterValue ) );
- } catch {}
+ } catch ( error ) {
+ dispatch( receiveDownloadableBlocks( [], filterValue ) );
+ }
};
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Reproduction Report
Description
This report validates whether the issue can be reproduced.
Environment
Actual Results
✅ Error condition occurs (reproduced).
Supplemental Artifacts
Video: https://utfs.io/f/PL8E4NiPUWyO7WG5Lz9AWOSNT8iuxYqzcvCVIEKbQmF3njPo