forked from cory/tildefriends
Oops. Fix votes.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3807 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
@ -256,7 +256,7 @@ async function getVotes(db, id) {
|
||||
if (!f || f.version != k_version) {
|
||||
f = {votes: [], sequence: 0, version: k_version};
|
||||
}
|
||||
if (g_sequence[id] > f.sequence) {
|
||||
if (!g_sequence[id] || g_sequence[id] > f.sequence) {
|
||||
await ssb.sqlStream(
|
||||
"SELECT "+
|
||||
" author, "+
|
||||
@ -271,7 +271,7 @@ async function getVotes(db, id) {
|
||||
" json_extract(content, '$.type') = 'vote' "+
|
||||
"UNION SELECT NULL, NULL, MAX(sequence), NULL, NULL FROM messages WHERE author = ? "+
|
||||
"ORDER BY sequence DESC LIMIT ?",
|
||||
[f.sequence, id, id, k_votes_max],
|
||||
[id, f.sequence, id, k_votes_max],
|
||||
function(row) {
|
||||
if (row.id) {
|
||||
votes.push(row);
|
||||
|
Reference in New Issue
Block a user