close screensaver if its running

This commit is contained in:
Justin 2023-08-22 22:47:02 +08:00 committed by GitHub
parent 92b43c32d8
commit 8809e6eaf0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1705,6 +1705,8 @@ def saveSchedulerSettings():
@app.route("/saveScreensaverSettings", methods = ['PUT', 'POST'])
def saveScreensaverSettings():
global displaying_screensaver
data = request.data.decode('utf-8')
input_settings = json.loads(data)
@ -1736,6 +1738,10 @@ def saveScreensaverSettings():
with open('clock_screensaver.json', 'w') as f:
json.dump(clock_screensaver,f)
if displaying_screensaver:
screensaver_p.close()
displaying_screensaver = False
return index()