Skip to content

Commit 03a9a80

Browse files
committed
Fix old templates library not showing templates data on page load
1 parent ecf19c9 commit 03a9a80

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

client/App.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ class App extends React.Component {
253253
syncing: false,
254254
} );
255255

256-
this.handleSort( 'latest', 'templates' );
257-
this.handleSort( 'latest', 'blocks' );
256+
this.handleSort( 'latest', 'templates', library.templates );
257+
this.handleSort( 'latest', 'blocks', library.blocks );
258258

259259
// Listen for Elementor modal close, so we can reset some states.
260260
document.addEventListener( 'modal-close', () => {
@@ -291,12 +291,12 @@ class App extends React.Component {
291291
}
292292
}
293293

294-
handleSort( value, library = 'templates' ) {
294+
handleSort( value, library = 'templates', data = false ) {
295295
this.setState( {
296296
showing_favorites: false,
297297
} );
298298

299-
const sortData = this.state[ library ];
299+
const sortData = ( ! data ) ? this.state[ library ] : data;
300300

301301
if ( 'popular' === value ) {
302302
const sorted = sortData.sort( ( a, b ) => {

0 commit comments

Comments
 (0)