mirror of
https://github.com/onionshare/onionshare.git
synced 2024-12-24 23:09:42 -05:00
Merge pull request #1287 from SaptakS/fix-persistent
Fixes issues with persistent mode
This commit is contained in:
commit
ee20c648c6
@ -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