Skip to content

Commit f612814

Browse files
committed
use limit and actualLimit, to avoid saving the default value
1 parent 340049a commit f612814

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/js/storage.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -452,10 +452,10 @@ 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.limit = 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'],
458-
follow.limit)
458+
follow.actualLimit)
459459
follow.sortedBy = meta.sortedBy
460460

461461
//

src/js/view.js

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

163163
<button onclick={e => {u('#working').attr('style', 'display: block'); return actions.follows.save(follow)}}>Save</button>
@@ -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.limit || 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)