Send stay_open variable in the right place, so that it really does stay open if we said so

This commit is contained in:
Miguel Jacq 2017-05-20 16:59:13 +10:00
parent d3eeda887b
commit f446f6630d
No known key found for this signature in database
GPG Key ID: EEA4341C6D97A0B6

View File

@ -203,7 +203,6 @@ class OnionShareGui(QtWidgets.QMainWindow):
settings = Settings()
settings.load()
self.app.set_stealth(settings.get('use_stealth'))
web.set_stay_open(not settings.get('close_after_first_download'))
# Reset web counters
web.download_count = 0
@ -221,6 +220,11 @@ class OnionShareGui(QtWidgets.QMainWindow):
return
# start onionshare http service in new thread
# First, load settings and configure
settings = Settings()
settings.load()
self.app.stay_open = not settings.get('close_after_first_download')
common.log('OnionShareGUI', 'stay_open', 'stay_open={}'.format(self.app.stay_open))
t = threading.Thread(target=web.start, args=(self.app.port, self.app.stay_open))
t.daemon = True
t.start()