Commit 73ce52087fc4eb16ae6fef1818817c6f2fcd5a52
whoops, better opts.lt.value.timestamp check
Matt McKegg committed on 6/21/2017, 1:22:40 AMParent: 54d1529773b8b8bc33c3529ca12237ddccb78c32
Files changed
feed/pull/channel.js | changed |
feed/pull/mentions.js | changed |
feed/pull/private.js | changed |
feed/pull/profile.js | changed |
feed/pull/public.js | changed |
feed/pull/channel.js | ||
---|---|---|
@@ -11,9 +11,9 @@ | ||
11 | 11 … | if (typeof channel !== 'string') throw new Error('a channel name be specified') |
12 | 12 … | |
13 | 13 … | return function (opts) { |
14 | 14 … | // handle last item passed in as lt |
15 | - var lt = (opts.lt && typeof opts.lt === 'object') | |
15 … | + var lt = (opts.lt && opts.lt.value) | |
16 | 16 … | ? opts.lt.value.timestamp |
17 | 17 … | : opts.lt |
18 | 18 … | |
19 | 19 … | delete opts.lt |
feed/pull/mentions.js | |||
---|---|---|---|
@@ -14,9 +14,9 @@ | |||
14 | 14 … | if (!ref.isFeed(id)) throw new Error('a feed id must be specified') | |
15 | 15 … | ||
16 | 16 … | return function getStream (opts) { | |
17 | 17 … | // handle last item passed in as lt | |
18 | - var lt = (opts.lt && typeof opts.lt === 'object') | ||
18 … | + var lt = (opts.lt && opts.lt.value) | ||
19 | 19 … | ? opts.lt.timestamp | |
20 | 20 … | : opts.lt | |
21 | 21 … | ||
22 | 22 … | opts = extend(opts, { |
feed/pull/private.js | ||
---|---|---|
@@ -10,9 +10,9 @@ | ||
10 | 10 … | |
11 | 11 … | exports.create = function (api) { |
12 | 12 … | return nest('feed.pull.private', function (opts) { |
13 | 13 … | // handle last item passed in as lt |
14 | - var lt = (opts.lt && typeof opts.lt === 'object') | |
14 … | + var lt = (opts.lt && opts.lt.value) | |
15 | 15 … | ? opts.lt.timestamp |
16 | 16 … | : opts.lt |
17 | 17 … | delete opts.lt |
18 | 18 … |
feed/pull/profile.js | ||
---|---|---|
@@ -8,9 +8,9 @@ | ||
8 | 8 … | return nest('feed.pull.profile', (id) => { |
9 | 9 … | // handle last item passed in as lt |
10 | 10 … | return function (opts) { |
11 | 11 … | opts = extend(opts, { |
12 | - id, lt: (opts.lt && typeof opts.lt === 'object') ? opts.lt.value.sequence : opts.lt | |
12 … | + id, lt: (opts.lt && opts.lt.value) ? opts.lt.value.sequence : opts.lt | |
13 | 13 … | }) |
14 | 14 … | return pull( |
15 | 15 … | api.sbot.pull.userFeed(opts), |
16 | 16 … | pull.filter(msg => { |
feed/pull/public.js | ||
---|---|---|
@@ -4,9 +4,9 @@ | ||
4 | 4 … | exports.needs = nest('sbot.pull.feed', 'first') |
5 | 5 … | exports.create = function (api) { |
6 | 6 … | return nest('feed.pull.public', (opts) => { |
7 | 7 … | // handle last item passed in as lt |
8 | - opts.lt = (opts.lt && typeof opts.lt === 'object') | |
8 … | + opts.lt = (opts.lt && opts.lt.value) | |
9 | 9 … | ? opts.lt.value.timestamp |
10 | 10 … | : opts.lt |
11 | 11 … | return api.sbot.pull.feed(opts) |
12 | 12 … | }) |
Built with git-ssb-web