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:
Torsten Schulz (local)
2025-11-24 12:24:31 +01:00
parent 4510aa3d14
commit d36901aa2b

View File

@@ -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();
}
},