fix: make tag aliases syncable

This commit is contained in:
thecodrr
2021-09-03 12:20:58 +05:00
parent 765befa580
commit 099befd565
3 changed files with 25 additions and 5 deletions

View File

@@ -37,6 +37,7 @@ class Settings {
...item.groupOptions,
...this._settings.groupOptions,
};
this._settings.aliases = {};
} else {
this._initSettings(item);
}
@@ -68,6 +69,15 @@ class Settings {
);
}
async setAlias(id, name) {
this._settings.aliases[id] = name;
await this._saveSettings();
}
getAlias(id) {
return this._settings.aliases[id];
}
async pin(type, data) {
if (type !== "notebook" && type !== "topic" && type !== "tag")
throw new Error("This item cannot be pinned.");
@@ -120,6 +130,7 @@ class Settings {
id: id(),
pins: [],
groupOptions: {},
aliases: {},
dateEdited: 0,
dateCreated: 0,
...(settings || {}),