iOS: fixed #1166 (keyboard shortcut story skipping)

Easy enough fix. Can’t trust the nextPage.pageIndex, as the view may not have been reused yet in the middle of scrolling.
This commit is contained in:
David Sinclair 2019-01-25 19:18:06 -08:00
parent d86e0b5234
commit eb7b049679

View file

@ -1025,23 +1025,24 @@
}
- (void)changeToNextPage:(id)sender {
NSInteger nextPageIndex = nextPage.pageIndex;
if (nextPageIndex < 0 && currentPage.pageIndex < 0) {
if (nextPage.pageIndex < 0 && currentPage.pageIndex < 0) {
// just displaying a placeholder - display the first story instead
[self changePage:0 animated:YES];
return;
}
[self changePage:nextPageIndex animated:YES];
[self changePage:currentPage.pageIndex + 1 animated:YES];
}
- (void)changeToPreviousPage:(id)sender {
NSInteger previousPageIndex = previousPage.pageIndex;
if (previousPageIndex < 0) {
if (currentPage.pageIndex < 0)
if (previousPage.pageIndex < 0) {
if (currentPage.pageIndex < 0) {
[self changeToNextPage:sender];
}
return;
}
[self changePage:previousPageIndex animated:YES];
[self changePage:currentPage.pageIndex - 1 animated:YES];
}
- (void)setStoryFromScroll {