You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-15 23:00:36 +02:00
Fixed limit issue
This commit is contained in:
@ -2,6 +2,5 @@
|
|||||||
set -e
|
set -e
|
||||||
CLIENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
CLIENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
#bash $CLIENT_DIR/build.sh && NODE_PATH="$CLIENT_DIR/build/" node build/main.js --profile ~/Temp/TestNotes2 --stack-trace-enabled --log-level debug --env dev "$@"
|
bash $CLIENT_DIR/build.sh && NODE_PATH="$CLIENT_DIR/build/" node build/main.js --profile ~/Temp/TestNotes2 --stack-trace-enabled --log-level debug --env dev "$@"
|
||||||
|
#bash $CLIENT_DIR/build.sh && NODE_PATH="$CLIENT_DIR/build/" node build/main.js --stack-trace-enabled --log-level debug "$@"
|
||||||
bash $CLIENT_DIR/build.sh && NODE_PATH="$CLIENT_DIR/build/" node build/main.js --stack-trace-enabled --log-level debug "$@"
|
|
||||||
|
@ -151,6 +151,8 @@ class BaseModel {
|
|||||||
params.push(pattern);
|
params.push(pattern);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ('limit' in options && options.limit <= 0) return [];
|
||||||
|
|
||||||
let sql = 'SELECT ' + this.db().escapeFields(options.fields) + ' FROM `' + this.tableName() + '`';
|
let sql = 'SELECT ' + this.db().escapeFields(options.fields) + ' FROM `' + this.tableName() + '`';
|
||||||
if (conditions.length) sql += ' WHERE ' + conditions.join(' AND ');
|
if (conditions.length) sql += ' WHERE ' + conditions.join(' AND ');
|
||||||
|
|
||||||
|
@ -165,6 +165,7 @@ class Note extends BaseItem {
|
|||||||
|
|
||||||
tempOptions = Object.assign({}, options);
|
tempOptions = Object.assign({}, options);
|
||||||
tempOptions.conditions = cond;
|
tempOptions.conditions = cond;
|
||||||
|
if ('limit' in tempOptions) tempOptions.limit -= uncompletedTodos.length;
|
||||||
let theRest = await this.search(tempOptions);
|
let theRest = await this.search(tempOptions);
|
||||||
|
|
||||||
return uncompletedTodos.concat(theRest);
|
return uncompletedTodos.concat(theRest);
|
||||||
|
Reference in New Issue
Block a user