mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-27 14:57:25 -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:
|
if persistent_filename:
|
||||||
mode_settings = ModeSettings(common, persistent_filename)
|
mode_settings = ModeSettings(common, persistent_filename)
|
||||||
mode_settings.set("persistent", "enabled", True)
|
mode_settings.set("persistent", "enabled", True)
|
||||||
|
mode_settings.set("persistent", "mode", mode)
|
||||||
else:
|
else:
|
||||||
mode_settings = ModeSettings(common)
|
mode_settings = ModeSettings(common)
|
||||||
|
|
||||||
@ -292,7 +293,7 @@ def main(cwd=None):
|
|||||||
if mode == "share" or mode == "website":
|
if mode == "share" or mode == "website":
|
||||||
# Unless you passed in a persistent filename, in which case get the filenames from
|
# Unless you passed in a persistent filename, in which case get the filenames from
|
||||||
# the mode settings
|
# 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")
|
filenames = mode_settings.get(mode, "filenames")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
@ -316,6 +317,11 @@ def main(cwd=None):
|
|||||||
if not valid:
|
if not valid:
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
|
# Save the filenames in persistent file
|
||||||
|
if persistent_filename:
|
||||||
|
mode_settings.set(mode, "filenames", filenames)
|
||||||
|
|
||||||
|
|
||||||
# Create the Web object
|
# Create the Web object
|
||||||
web = Web(common, False, mode_settings, mode)
|
web = Web(common, False, mode_settings, mode)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user