Refactor tab change logic in PoliticsView to simplify loading conditions
- Updated the onTabChange method to remove unnecessary checks for existing data before loading current positions, open politics, and elections. - This change enhances the clarity of the method and ensures that data is always loaded when the respective tab is selected.
This commit is contained in:
@@ -206,13 +206,13 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
onTabChange(tab) {
|
||||
if (tab === 'current' && !this.currentPositions.length) {
|
||||
if (tab === 'current') {
|
||||
this.loadCurrentPositions();
|
||||
}
|
||||
if (tab === 'openPolitics' && !this.openPolitics.length) {
|
||||
if (tab === 'openPolitics') {
|
||||
this.loadOpenPolitics();
|
||||
}
|
||||
if (tab === 'elections' && !this.elections.length) {
|
||||
if (tab === 'elections') {
|
||||
this.loadElections();
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user