return connectivity html even when IO is stopped.

The returned error is unexpected and no UI I tested with stoped IO really handled it besides maybe displaying a toast.
(desktop and iOS don't handle it, deltatouch shows a toast)

This should not be shown to the user, it is only shown to the user if the UI has a bug, so that bug should be clearly visible.
This commit is contained in:
Simon Laux
2023-11-15 06:05:05 +01:00
committed by Simon Laux
parent 0f36197c54
commit 990f4dce9b

View File

@@ -2,7 +2,7 @@ use core::fmt;
use std::cmp::min; use std::cmp::min;
use std::{iter::once, ops::Deref, sync::Arc}; use std::{iter::once, ops::Deref, sync::Arc};
use anyhow::{anyhow, Result}; use anyhow::Result;
use humansize::{format_size, BINARY}; use humansize::{format_size, BINARY};
use tokio::sync::Mutex; use tokio::sync::Mutex;
@@ -299,6 +299,10 @@ impl Context {
.yellow { .yellow {
background-color: #fdc625; background-color: #fdc625;
} }
.not-started-error {
font-size: 2em;
color: red;
}
</style> </style>
</head> </head>
<body>"# <body>"#
@@ -318,7 +322,8 @@ impl Context {
sched.smtp.state.connectivity.clone(), sched.smtp.state.connectivity.clone(),
), ),
_ => { _ => {
return Err(anyhow!("Not started")); ret += "<div class=\"not-started-error\">Error: IO Not Started</div><p>Please report this issue to the app developer.</p>\n</body></html>\n";
return Ok(ret);
} }
}; };
drop(lock); drop(lock);