Skip to content

Commit 117f082

Browse files
committed
customizable follow.limit
1 parent 9b587e8 commit 117f082

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/js/storage.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -452,11 +452,11 @@ 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
455456
follow.posts = frago.master(meta,
456457
meta.sortBy ? [meta.sortBy] : ['publishedAt', 'updatedAt'],
457-
POSTS_IN_MAIN_INDEX)
458+
follow.limit)
458459
follow.sortedBy = meta.sortedBy
459-
follow.limit = POSTS_IN_MAIN_INDEX
460460

461461
//
462462
// Build the 'activity' array - most recent first, then trim

src/js/view.js

+7
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,13 @@ const FollowForm = (match, setup, isNew) => ({follows}, actions) => {
153153
<p class="note">(Check this to save a copy of complete posts and read them from Fraidycat.)</p>
154154
</div>}
155155

156+
<div>
157+
<label for="title" class="optional">Limit</label>
158+
<input type="number" id="limit" value={follow.limit} min='0' step='1'
159+
oninput={e => follow.limit = e.target.value} />
160+
<p class="note">(Number of recent feed entries to show)</p>
161+
</div>
162+
156163
<button onclick={e => {u('#working').attr('style', 'display: block'); return actions.follows.save(follow)}}>Save</button>
157164
{!isNew && <button type="button" class="delete" onclick={_ => actions.follows.confirmRemove(follow)}>Delete This</button>}
158165

0 commit comments

Comments
 (0)