mirror of
https://github.com/liamcottle/reticulum-meshchat.git
synced 2026-04-27 16:10:32 +00:00
ensure propagation node is configured before attempting to sync
This commit is contained in:
parent
001ae5cb01
commit
1504bec4dc
2 changed files with 12 additions and 2 deletions
|
|
@ -840,6 +840,12 @@ class ReticulumMeshChat:
|
|||
@routes.get("/api/v1/lxmf/propagation-node/sync")
|
||||
async def index(request):
|
||||
|
||||
# ensure propagation node is configured before attempting to sync
|
||||
if self.message_router.get_outbound_propagation_node() is None:
|
||||
return web.json_response({
|
||||
"message": "A propagation node must be configured to sync messages.",
|
||||
}, status=400)
|
||||
|
||||
# request messages from propagation node
|
||||
self.message_router.request_messages_from_propagation_node(self.identity)
|
||||
|
||||
|
|
|
|||
|
|
@ -406,11 +406,15 @@ export default {
|
|||
// request sync
|
||||
try {
|
||||
await axios.get("/api/v1/lxmf/propagation-node/sync");
|
||||
await this.updatePropagationNodeStatus();
|
||||
} catch(e) {
|
||||
DialogUtils.alert("Failed to sync propagation node");
|
||||
const errorMessage = e.response?.data?.message ?? "Something went wrong. Try again later.";
|
||||
DialogUtils.alert(errorMessage);
|
||||
return;
|
||||
}
|
||||
|
||||
// update propagation status
|
||||
await this.updatePropagationNodeStatus();
|
||||
|
||||
// wait until sync has finished
|
||||
const syncFinishedInterval = setInterval(() => {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue