Skip to content

Commit

Permalink
Fix/error on default sort (#11364)
Browse files Browse the repository at this point in the history
* Fix error when resetting on default sort

* Lint

* Fix error on default sort (2)

* Lint
  • Loading branch information
medariox authored Jun 27, 2023
1 parent 4f2adbc commit 7d4d600
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
3 changes: 3 additions & 0 deletions themes-default/slim/src/components/history-compact.vue
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ export default {
const { getCookie } = this;
const sort = getCookie('sort'); // From manage-cookie.js mixin
if (sort) {
if (sort[0].type === 'none') {
sort[0].type = 'desc';
}
return sort;
}
return [{ field: 'date', type: 'desc' }];
Expand Down
3 changes: 3 additions & 0 deletions themes-default/slim/src/components/history-detailed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,9 @@ export default {
const { getCookie } = this;
const sort = getCookie('sort'); // From manage-cookie.js mixin
if (sort) {
if (sort[0].type === 'none') {
sort[0].type = 'desc';
}
return sort;
}
return [{ field: 'date', type: 'desc' }];
Expand Down
2 changes: 1 addition & 1 deletion themes-default/slim/src/mixins/manage-cookie.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const manageCookieMixin = cookiePrefix => {
try {
return JSON.parse(cookie);
} catch {
return cookie === 'none' ? null : cookie;
return cookie;
}
},
setCookie(key, value) {
Expand Down
6 changes: 3 additions & 3 deletions themes/dark/assets/js/medusa-runtime.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions themes/light/assets/js/medusa-runtime.js

Large diffs are not rendered by default.

0 comments on commit 7d4d600

Please sign in to comment.