Spaces:
Runtime error
Runtime error
Updated the save button
#2
by
arkamaldeen
- opened
app.py
CHANGED
@@ -32,7 +32,7 @@ def load_css(file_path):
|
|
32 |
|
33 |
|
34 |
# Load CSS file
|
35 |
-
|
36 |
|
37 |
|
38 |
# ----- FUNCTIONS ----
|
@@ -318,26 +318,22 @@ def main():
|
|
318 |
|
319 |
with col1:
|
320 |
saved_button = False
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
if
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
else:
|
338 |
-
with open(file_path, "w", encoding="utf-8") as file:
|
339 |
-
file.write(data)
|
340 |
-
saved_button = True
|
341 |
|
342 |
with col2:
|
343 |
if st.button("Clear"):
|
|
|
32 |
|
33 |
|
34 |
# Load CSS file
|
35 |
+
load_css('styles.css')
|
36 |
|
37 |
|
38 |
# ----- FUNCTIONS ----
|
|
|
318 |
|
319 |
with col1:
|
320 |
saved_button = False
|
321 |
+
|
322 |
+
if is_a_sitemap:
|
323 |
+
saved_data = st.session_state.sitemap_data
|
324 |
+
|
325 |
+
if st.download_button(
|
326 |
+
label="Save",
|
327 |
+
data=saved_data
|
328 |
+
):
|
329 |
+
saved_button = True
|
330 |
+
|
331 |
+
else:
|
332 |
+
if st.download_button(
|
333 |
+
label="Save",
|
334 |
+
data=data
|
335 |
+
):
|
336 |
+
saved_button = True
|
|
|
|
|
|
|
|
|
337 |
|
338 |
with col2:
|
339 |
if st.button("Clear"):
|