mirror of
https://github.com/onionshare/onionshare.git
synced 2024-10-01 01:35:40 -04:00
Fixes issues with persistent mode
- adds mode to the persistent file - adds filenames for share and website mode in persistent file
This commit is contained in:
parent
754c4e9c10
commit
8a412fed85
@ -267,6 +267,7 @@ def main(cwd=None):
|
||||
if persistent_filename:
|
||||
mode_settings = ModeSettings(common, persistent_filename)
|
||||
mode_settings.set("persistent", "enabled", True)
|
||||
mode_settings.set("persistent", "mode", mode)
|
||||
else:
|
||||
mode_settings = ModeSettings(common)
|
||||
|
||||
@ -292,7 +293,7 @@ def main(cwd=None):
|
||||
if mode == "share" or mode == "website":
|
||||
# Unless you passed in a persistent filename, in which case get the filenames from
|
||||
# the mode settings
|
||||
if persistent_filename and not mode_settings.just_created:
|
||||
if persistent_filename and not mode_settings.just_created and len(filenames) != 0:
|
||||
filenames = mode_settings.get(mode, "filenames")
|
||||
|
||||
else:
|
||||
@ -316,6 +317,11 @@ def main(cwd=None):
|
||||
if not valid:
|
||||
sys.exit()
|
||||
|
||||
# Save the filenames in persistent file
|
||||
if persistent_filename:
|
||||
mode_settings.set(mode, "filenames", filenames)
|
||||
|
||||
|
||||
# Create the Web object
|
||||
web = Web(common, False, mode_settings, mode)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user