mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 06:59:31 +01:00
fix: init groupOptions if not initialized
This commit is contained in:
@@ -15,6 +15,7 @@ class Settings {
|
||||
|
||||
async init() {
|
||||
var settings = await this._db.context.read("settings");
|
||||
if (!settings.groupOptions) settings.groupOptions = {};
|
||||
if (settings) this._settings = settings;
|
||||
EV.subscribe(EVENTS.userLoggedOut, () => {
|
||||
this._settings = undefined;
|
||||
@@ -58,7 +59,14 @@ class Settings {
|
||||
* @returns {GroupOptions}
|
||||
*/
|
||||
getGroupOptions(key) {
|
||||
return this._settings.groupOptions[key];
|
||||
return (
|
||||
this._settings.groupOptions[key] || {
|
||||
groupId: undefined,
|
||||
sortBy: "dateEdited",
|
||||
groupBy: "dateEdited",
|
||||
sortDirection: "desc",
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
async pin(type, data) {
|
||||
|
||||
Reference in New Issue
Block a user