@internetarchive/collection-browser 4.1.0-alpha-webdev8186.3 → 4.1.0-alpha-webdev8186.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "permissions": {
3
3
  "allow": [
4
- "Bash(cd /c/Users/Laton/workspace/IA/iaux-collection-browser && npm test 2>&1)"
4
+ "Bash(cd /c/Users/Laton/workspace/IA/iaux-collection-browser && npm test 2>&1)",
5
+ "Bash(cd /c/Users/Laton/workspace/IA/iaux-collection-browser && yarn run format 2>&1)"
5
6
  ]
6
7
  }
7
8
  }
@@ -1365,6 +1365,16 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
1365
1365
  if (changed.has('profileElement')) {
1366
1366
  this.applyDefaultProfileSort();
1367
1367
  }
1368
+ if (changed.has('withinCollection') && this.withinCollection) {
1369
+ // Set a sensible default collection sort while we load results, which we will later
1370
+ // adjust based on any sort-by metadata once the response arrives.
1371
+ if (!this.baseQuery) {
1372
+ this.defaultSortField = this.withinCollection.startsWith('fav-')
1373
+ ? SortField.datefavorited
1374
+ : SortField.weeklyview;
1375
+ this.defaultSortDirection = 'desc';
1376
+ }
1377
+ }
1368
1378
  if (changed.has('baseQuery')) {
1369
1379
  this.emitBaseQueryChanged();
1370
1380
  }