From 652529bec358d3d1b2d234323e18ba6b28853eb4 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 29 Jan 2024 13:45:52 +0000 Subject: [PATCH] Only refresh mobile newswire screen within text mode browser --- daemon.py | 3 ++- webapp_column_right.py | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/daemon.py b/daemon.py index 873db1f61..3ac5e7884 100644 --- a/daemon.py +++ b/daemon.py @@ -19778,7 +19778,8 @@ class PubServer(BaseHTTPRequestHandler): icons_as_buttons, default_timeline, self.server.theme_name, - access_keys).encode('utf-8') + access_keys, + ua_str).encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, cookie, calling_domain, False) diff --git a/webapp_column_right.py b/webapp_column_right.py index d561bff15..386787f56 100644 --- a/webapp_column_right.py +++ b/webapp_column_right.py @@ -31,6 +31,7 @@ from webapp_utils import get_banner_file from webapp_utils import html_post_separator from webapp_utils import header_buttons_front_screen from webapp_utils import edit_text_field +from webapp_utils import text_mode_browser def _votes_indicator(total_votes: int, positive_voting: bool) -> str: @@ -483,7 +484,8 @@ def html_newswire_mobile(base_dir: str, nickname: str, icons_as_buttons: bool, default_timeline: str, theme: str, - access_keys: {}) -> str: + access_keys: {}, + ua_str: str) -> str: """Shows the mobile version of the newswire right column """ html_str = '' @@ -507,7 +509,9 @@ def html_newswire_mobile(base_dir: str, nickname: str, instance_title = \ get_config_param(base_dir, 'instanceTitle') - metadata = '\n' + metadata = None + if text_mode_browser(ua_str): + metadata = '\n' html_str = \ html_header_with_external_style(css_filename, instance_title, metadata)