load Settings in onionshare/__init__.py before we initiate the web thread, since it needs to send the saved slug to the web server

This commit is contained in:
Miguel Jacq 2018-01-18 22:42:43 +11:00
parent f499b126cc
commit 206472cb78
No known key found for this signature in database
GPG Key ID: 5418373DFF79BA19

View File

@ -115,6 +115,7 @@ def main(cwd=None):
print('')
# Start OnionShare http service in new thread
settings.load()
t = threading.Thread(target=web.start, args=(app.port, app.stay_open, settings.get('slug')))
t.daemon = True
t.start()
@ -128,7 +129,6 @@ def main(cwd=None):
app.shutdown_timer.start()
# Save the web slug if we are using a persistent private key
settings.load()
if settings.get('save_private_key'):
if not settings.get('slug'):
settings.set('slug', web.slug)