Ensure controls help is not shown more than once in a single session

This commit is contained in:
Kovid Goyal 2020-09-25 07:58:13 +05:30
parent a6b10869cf
commit 937bb880a3
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -892,10 +892,13 @@ class View:
else: else:
self.show_name(name, initial_position=pos) self.show_name(name, initial_position=pos)
sd = get_session_data() sd = get_session_data()
c = sd.get('controls_help_shown_count' + ('_rtl_page_progression' if rtl_page_progression() else ''), 0) help_key = 'controls_help_shown_count' + ('_rtl_page_progression' if rtl_page_progression() else '')
if c < 2: if not self[help_key]:
show_controls_help() self[help_key] = True
sd.set('controls_help_shown_count' + ('_rtl_page_progression' if rtl_page_progression() else ''), c + 1) c = sd.get(help_key, 0)
if c < 2:
show_controls_help()
sd.set('controls_help_shown_count' + ('_rtl_page_progression' if rtl_page_progression() else ''), c + 1)
def preferences_changed(self): def preferences_changed(self):
ui_operations.update_url_state(True) ui_operations.update_url_state(True)