mirror of
https://github.com/liamcottle/reticulum-meshchat.git
synced 2026-10-25 18:40:12 -04:00
Merge pull request #177 from Cryptoteep/fix/issue-173
Fix bug where toggling transport fails if reticulum config section is missing
This commit is contained in:
commit
a9f925975e
1 changed files with 8 additions and 0 deletions
|
|
@ -980,6 +980,10 @@ class ReticulumMeshChat:
|
|||
@routes.post("/api/v1/reticulum/enable-transport")
|
||||
async def index(request):
|
||||
|
||||
# ensure reticulum section exists
|
||||
if "reticulum" not in self.reticulum.config:
|
||||
self.reticulum.config["reticulum"] = {}
|
||||
|
||||
# enable transport mode
|
||||
self.reticulum.config["reticulum"]["enable_transport"] = True
|
||||
self.reticulum.config.write()
|
||||
|
|
@ -992,6 +996,10 @@ class ReticulumMeshChat:
|
|||
@routes.post("/api/v1/reticulum/disable-transport")
|
||||
async def index(request):
|
||||
|
||||
# ensure reticulum section exists
|
||||
if "reticulum" not in self.reticulum.config:
|
||||
self.reticulum.config["reticulum"] = {}
|
||||
|
||||
# disable transport mode
|
||||
self.reticulum.config["reticulum"]["enable_transport"] = False
|
||||
self.reticulum.config.write()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue