Page counts should not be deleted when opening controls

This commit is contained in:
Kovid Goyal 2020-10-14 16:05:21 +05:30
parent 5e67433334
commit 306deb01cb
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 5 additions and 1 deletions

View File

@ -202,7 +202,10 @@ def render_head_foot(div, which, region, metadata, current_toc_node, current_toc
else:
text = format_pos(pos.file_progress_frac, pos.chapter_length)
elif field is 'pages-progress':
text = f'{pos.page_counts.current + 1} / {pos.page_counts.total}'
if pos.page_counts:
text = f'{pos.page_counts.current + 1} / {pos.page_counts.total}'
else:
text = _('Unknown')
if not text:
text = '\xa0'
if text is not div.textContent:

View File

@ -1143,6 +1143,7 @@ class View:
'file_progress_frac': data.file_progress_frac,
'selected_text': data.selected_text,
'selection_bounds': data.selection_bounds,
'page_counts': data.page_counts
})
v'delete self.report_cfi_callbacks[data.request_id]'