mirror of
https://github.com/zadam/trilium.git
synced 2025-12-12 10:24:23 +01:00
chore(client): address requested changes
This commit is contained in:
parent
58bc5dc66a
commit
6e8e10323f
@ -28,15 +28,13 @@ export function getEnabledExperimentalFeatureIds() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function toggleExperimentalFeature(featureId: ExperimentalFeatureId, enable: boolean) {
|
export async function toggleExperimentalFeature(featureId: ExperimentalFeatureId, enable: boolean) {
|
||||||
let features = Array.from(getEnabledFeatures());
|
const features = new Set(getEnabledFeatures());
|
||||||
if (enable) {
|
if (enable) {
|
||||||
if (!features.includes(featureId)) {
|
features.add(featureId);
|
||||||
features.push(featureId);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
features = features.filter(f => f !== featureId);
|
features.delete(featureId);
|
||||||
}
|
}
|
||||||
await options.save("experimentalFeatures", JSON.stringify(features));
|
await options.save("experimentalFeatures", JSON.stringify(Array.from(features)));
|
||||||
}
|
}
|
||||||
|
|
||||||
function getEnabledFeatures() {
|
function getEnabledFeatures() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user