diff --git a/frontend/src/App.js b/frontend/src/App.js
index 58b2396..e0efa04 100644
--- a/frontend/src/App.js
+++ b/frontend/src/App.js
@@ -546,10 +546,16 @@ function App() {
React.useEffect(() => {
if (selectedCategory) {
if (currentView === 'labor-prices') {
+ setLaborPrices([]); // Clear existing data
loadLaborPrices(selectedCategory);
} else if (currentView === 'material-prices') {
+ setMaterialPrices([]); // Clear existing data
loadMaterialPrices(selectedCategory);
}
+ } else {
+ // Clear data when no category selected
+ setLaborPrices([]);
+ setMaterialPrices([]);
}
}, [selectedCategory, currentView]);
@@ -698,13 +704,25 @@ function App() {
@@ -965,12 +983,25 @@ function App() {
👷 Tømrer Priser
Se tidligere arbejdspriser og tilføj nye timelønssatser for forskellige projekttyper.
+ {error && (
+
+ {error}
+
+ )}
+
+ {loading && (
+
+ Indlæser data...
+
+ )}
+