File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change 1+ Significance: patch
2+ Type: changed
3+
4+ Forms: Make dashboard initialization idempotent for SPA environments by using data attribute to track state
Original file line number Diff line number Diff line change @@ -21,23 +21,17 @@ declare global {
2121 }
2222}
2323
24- let isInitialized = false ;
25-
2624/**
2725 * Initialize the Forms dashboard
2826 */
2927function initFormsDashboard ( ) {
30- if ( isInitialized ) {
31- return ;
32- }
33-
3428 const container = document . getElementById ( 'jp-forms-dashboard' ) ;
3529
36- if ( ! container ) {
30+ if ( ! container || container . dataset . formsInitialized ) {
3731 return ;
3832 }
3933
40- isInitialized = true ;
34+ container . dataset . formsInitialized = ' true' ;
4135
4236 const router = createHashRouter ( [
4337 {
You can’t perform that action at this time.
0 commit comments