Skip to content

Commit b0ea069

Browse files
committed
limit should be a number, not a string
1 parent e089f1f commit b0ea069

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/js/storage.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ module.exports = {
452452
// Select the top posts for every possible sort method, to give us a limited
453453
// index of the posts that each filter method would select.
454454
//
455-
follow.actualLimit = follow.limit || POSTS_IN_MAIN_INDEX
455+
follow.actualLimit = follow.limit ?? POSTS_IN_MAIN_INDEX
456456
follow.posts = frago.master(meta,
457457
meta.sortBy ? [meta.sortBy] : ['publishedAt', 'updatedAt'],
458458
follow.actualLimit)

src/js/view.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ const FollowForm = (match, setup, isNew) => ({follows}, actions) => {
156156
<div>
157157
<label for="title" class="optional">Limit</label>
158158
<input type="number" id="limit" value={follow.limit} min='0' step='1'
159-
oninput={e => follow.limit = e.target.value} />
159+
oninput={e => follow.limit = e.target.value ? parseInt(e.target.value) : undefined} />
160160
<p class="note">Number of recent feed entries to show. (If left blank, defaults to 10)</p>
161161
</div>
162162

@@ -423,7 +423,7 @@ const ListFollow = ({ location, match }) => ({follows}, actions) => {
423423
{follow.posts instanceof Array && follow.posts.length > 0 &&
424424
<div class="post">
425425
<ol class="title">{(showReposts ? follow.posts : follow.posts.filter(x => !x.author || x.author === follow.author)).
426-
slice(0, follow.actualLimit || 10).map(f => {
426+
slice(0, follow.actualLimit ?? 10).map(f => {
427427
let postAge = timeAgo(f[sortPosts], now)
428428
return <li class={timeDarkness(f[sortPosts], now)}>
429429
{f.author && f.author !== follow.author && <span class="author">{f.author}</span>}

0 commit comments

Comments
 (0)