From 2dc99c8d18301da2020572719e35963b43c355a1 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Thu, 7 Apr 2022 03:18:46 +0200 Subject: [PATCH] fds --- files/__main__.py | 2 ++ files/routes/static.py | 9 ++++++++- files/templates/home.html | 28 ++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/files/__main__.py b/files/__main__.py index 9f4231d30..0b2d69278 100644 --- a/files/__main__.py +++ b/files/__main__.py @@ -106,6 +106,8 @@ def before_request(): if 'iphone' in ua or 'ipad' in ua or 'ipod' in ua or 'mac os' in ua or ' firefox/' in ua: g.inferior_browser = True else: g.inferior_browser = False + g.timestamp = int(time.time()) + @app.teardown_appcontext def teardown_request(error): diff --git a/files/routes/static.py b/files/routes/static.py index 132d57c81..9c7b351a5 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -425,4 +425,11 @@ def settings_security(v): @app.get("/.well-known/assetlinks.json") def googleplayapp(): with open("files/assets/assetlinks.json", "r") as f: - return Response(f.read(), mimetype='application/json') \ No newline at end of file + return Response(f.read(), mimetype='application/json') + + + +@app.post("/dismiss_mobile_tip") +def dismiss_mobile_tip(): + session["tooltip_last_dismissed"] = int(time.time()) + return "", 204 \ No newline at end of file diff --git a/files/templates/home.html b/files/templates/home.html index 58c0f5593..164bc6dcd 100644 --- a/files/templates/home.html +++ b/files/templates/home.html @@ -260,4 +260,32 @@ {% endif %} +{% if request.path == '/' and g.timestamp > session.get('tooltip_last_dismissed',0)+60*60*24*30 and not g.webview %} +
+
+
+ + + + +{% endif %} + {% endblock %} \ No newline at end of file