Only refresh mobile newswire screen within text mode browser

main
Bob Mottram 2024-01-29 13:45:52 +00:00
parent 3014ef5aa5
commit 652529bec3
2 changed files with 8 additions and 3 deletions

View File

@ -19778,7 +19778,8 @@ class PubServer(BaseHTTPRequestHandler):
icons_as_buttons, icons_as_buttons,
default_timeline, default_timeline,
self.server.theme_name, self.server.theme_name,
access_keys).encode('utf-8') access_keys,
ua_str).encode('utf-8')
msglen = len(msg) msglen = len(msg)
self._set_headers('text/html', msglen, self._set_headers('text/html', msglen,
cookie, calling_domain, False) cookie, calling_domain, False)

View File

@ -31,6 +31,7 @@ from webapp_utils import get_banner_file
from webapp_utils import html_post_separator from webapp_utils import html_post_separator
from webapp_utils import header_buttons_front_screen from webapp_utils import header_buttons_front_screen
from webapp_utils import edit_text_field from webapp_utils import edit_text_field
from webapp_utils import text_mode_browser
def _votes_indicator(total_votes: int, positive_voting: bool) -> str: 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, icons_as_buttons: bool,
default_timeline: str, default_timeline: str,
theme: str, theme: str,
access_keys: {}) -> str: access_keys: {},
ua_str: str) -> str:
"""Shows the mobile version of the newswire right column """Shows the mobile version of the newswire right column
""" """
html_str = '' html_str = ''
@ -507,6 +509,8 @@ def html_newswire_mobile(base_dir: str, nickname: str,
instance_title = \ instance_title = \
get_config_param(base_dir, 'instanceTitle') get_config_param(base_dir, 'instanceTitle')
metadata = None
if text_mode_browser(ua_str):
metadata = '<meta http-equiv="refresh" content="1800" >\n' metadata = '<meta http-equiv="refresh" content="1800" >\n'
html_str = \ html_str = \
html_header_with_external_style(css_filename, instance_title, metadata) html_header_with_external_style(css_filename, instance_title, metadata)