fix: move pinned notebooks to the top

This commit is contained in:
thecodrr
2020-03-02 15:40:20 +05:00
parent f1644add76
commit 7cda89229e

View File

@@ -3,6 +3,8 @@ import fuzzysearch from "fuzzysearch";
import Notebook from "../models/notebook"; import Notebook from "../models/notebook";
import Notes from "./notes"; import Notes from "./notes";
import Trash from "./trash"; import Trash from "./trash";
import sort from "fast-sort";
var tfun = require("transfun/transfun.js").tfun; var tfun = require("transfun/transfun.js").tfun;
if (!tfun) { if (!tfun) {
tfun = global.tfun; tfun = global.tfun;
@@ -61,7 +63,7 @@ export default class Notebooks {
} }
get all() { get all() {
return this._collection.getAllItems(); return sort(this._collection.getAllItems()).desc(t => t.pinned);
} }
get pinned() { get pinned() {