diff --git a/files/__main__.py b/files/__main__.py index 9f4231d300..0b2d69278a 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 132d57c811..9c7b351a58 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 58c0f55931..164bc6dcda 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