Changeset 50067
- Timestamp:
- 01/29/2021 01:34:05 AM (4 years ago)
- Location:
- trunk/src/js/media/models
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/media/models/attachments.js
r48989 r50067 391 391 if ( this.props.get('query') ) { 392 392 props = this.props.toJSON(); 393 props.cache = ( true !== refresh );394 393 this.mirror( wp.media.model.Query.get( props ) ); 395 394 } -
trunk/src/js/media/models/query.js
r50029 r50067 214 214 * 215 215 * @param {object} [props] 216 * @param {Object} [props.cache=true] Whether to use the query cache or not.217 216 * @param {Object} [props.order] 218 217 * @param {Object} [props.orderby] … … 244 243 orderby = Query.orderby, 245 244 defaults = Query.defaultProps, 246 query, 247 cache = !! props.cache || _.isUndefined( props.cache ); 245 query; 248 246 249 247 // Remove the `query` property. This isn't linked to a query, 250 248 // this *is* the query. 251 249 delete props.query; 252 delete props.cache;253 250 254 251 // Fill default args. … … 289 286 args.orderby = orderby.valuemap[ props.orderby ] || props.orderby; 290 287 291 // Search the query cache for a matching query. 292 if ( cache ) { 293 query = _.find( queries, function( query ) { 294 return _.isEqual( query.args, args ); 295 }); 296 } else { 297 queries = []; 298 } 288 queries = []; 299 289 300 290 // Otherwise, create a new query and add it to the cache.
Note: See TracChangeset
for help on using the changeset viewer.