fix: Don't allow alerts without an ID to be dismissed
All checks were successful
Build Docker / Build Images (map[dockerfile:Dockerfile tag_suffix: target:default]) (push) Successful in 2m58s
Tests and Linting / Tests-Linting (3.13) (push) Successful in 3m4s
Tests and Linting / Tests-Linting (3.11) (push) Successful in 3m6s
Tests and Linting / Tests-Linting (3.10) (push) Successful in 3m10s
Build Docker / Build Images (map[dockerfile:Dockerfile.hsd tag_suffix:-hsd target:hsd]) (push) Successful in 11m1s

This commit is contained in:
2025-09-11 15:07:19 +10:00
parent eb6306bb83
commit 7fc19a7f19

View File

@@ -74,6 +74,7 @@ def index():
alerts = get_alerts(account)
for alert in alerts:
output_html = alert['output']
if 'id' in alert:
# Add a dismiss button
output_html += f"&nbsp<a href='/dismiss/{alert['id']}' class='btn btn-secondary btn-sm' style='margin:none;'>Dismiss</a>"
plugins += render_template('components/dashboard-alert.html', name=alert['name'], output=output_html)
@@ -1920,7 +1921,7 @@ def get_alerts(account:str) -> list:
logger.info("New version available")
alerts.append({
"name": "Update Available",
"output": f"A new version of FireWallet is available. <a href='https://git.woodburn.au/nathanwoodburn/firewalletbrowser/compare/{commit}...{branch}' target='_blank'>Changelog</a>."
"output": f"A new version of FireWallet is available. <a href='https://git.woodburn.au/nathanwoodburn/firewalletbrowser/compare/{commit}...{branch}' target='_blank'>Changelog</a>"
})