Using non-hardcoded value for pagnagtion
@@ -112,7 +112,7 @@ pub fn handler(key: Key, app: &mut App) {
if let Some(selected_playlist) =
playlists.items.get(selected_playlist_index.to_owned())
{
- app.playlist_offset += 20;
+ app.playlist_offset += app.large_search_limit;
let playlist_id = selected_playlist.id.to_owned();
app.get_playlist_tracks(playlist_id);
}
@@ -135,8 +135,8 @@ pub fn handler(key: Key, app: &mut App) {
if let (Some(playlists), Some(selected_playlist_index)) =
(&app.playlists, &app.selected_playlist_index)
{
- if app.playlist_offset >= 20 {
- app.playlist_offset -= 20;
+ if app.playlist_offset >= app.large_search_limit {
+ app.playlist_offset -= app.large_search_limit;
};
if let Some(selected_playlist) =
playlists.items.get(selected_playlist_index.to_owned())
