Skip to content

Commit

Permalink
🐞 Fixed update chain dropdown (#448)
Browse files Browse the repository at this point in the history
* Fixed update chain dropdown

* test commit

* delete cauldronsLoading watcher

* delete selectedChains watcher

* updated method updateSelectedChain

* updated sort cauldrons To Render

---------

Co-authored-by: Andrey <[email protected]>
Co-authored-by: 0xhardrefresh <[email protected]>
  • Loading branch information
3 people authored Sep 20, 2024
1 parent add31e2 commit 80920ec
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions src/components/cauldrons/CauldronsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ export default {
searchValue: "",
showMyPositions: false,
showActiveCauldrons: true,
sortKey: "",
sortOrder: false,
sortKey: "TVL",
sortOrder: true,
selectedChains: [],
isFiltersPopupOpened: false,
};
Expand All @@ -109,13 +109,8 @@ export default {
const filteredByPositions = this.filterPositions(filteredByDepreciate);
const sortedByNew = this.sortByNew(filteredByPositions);
// TODO
const sortedByTesting = this.sortByTesting(filteredByPositions);
const filteredByValue = this.filterBySearchValue(
sortedByTesting,
filteredByPositions,
this.searchValue
);
Expand All @@ -125,7 +120,11 @@ export default {
this.sortOrder
);
return sortedByChain;
// const sortedByTesting = this.sortByTesting(sortedByChain);
const sortedByNew =
this.sortOrder === true ? this.sortByNew(sortedByChain) : sortedByChain;
return sortedByNew;
},
activeChains() {
Expand All @@ -151,8 +150,8 @@ export default {
},
watch: {
cauldrons() {
this.selectedChains = this.getActiveChain();
cauldronsLoading() {
if (!this.cauldronsLoading) this.selectedChains = this.getActiveChain();
},
},
Expand All @@ -166,8 +165,13 @@ export default {
},
updateSortKeys(key, order) {
this.sortKey = key;
this.sortOrder = order;
if (!order) {
this.sortKey = "TVL";
this.sortOrder = true;
} else {
this.sortKey = key;
this.sortOrder = order;
}
},
updateSearch(value) {
Expand All @@ -185,6 +189,8 @@ export default {
const index = this.selectedChains.indexOf(chainId);
if (index === -1) this.selectedChains.push(chainId);
else this.selectedChains.splice(index, 1);
if (!this.selectedChains.length) this.selectAllChains();
},
filterByChain(cauldrons, selectedChains) {
Expand Down

0 comments on commit 80920ec

Please sign in to comment.