2024-03-14 09:28:08 +08:00
|
|
|
import { tracked } from "@glimmer/tracking";
|
2023-11-02 08:34:37 +08:00
|
|
|
import Service from "@ember/service";
|
2024-03-14 09:28:08 +08:00
|
|
|
import { TrackedObject } from "@ember-compat/tracked-built-ins";
|
2023-11-02 08:34:37 +08:00
|
|
|
import KeyValueStore from "discourse/lib/key-value-store";
|
|
|
|
|
2024-03-14 09:28:08 +08:00
|
|
|
export default class AdminSidebarStateManager extends Service {
|
|
|
|
@tracked keywords = new TrackedObject();
|
2023-11-02 08:34:37 +08:00
|
|
|
STORE_NAMESPACE = "discourse_admin_sidebar_experiment_";
|
|
|
|
|
|
|
|
store = new KeyValueStore(this.STORE_NAMESPACE);
|
|
|
|
|
|
|
|
get navConfig() {
|
|
|
|
return this.store.getObject("navConfig");
|
|
|
|
}
|
|
|
|
|
|
|
|
set navConfig(value) {
|
|
|
|
this.store.setObject({ key: "navConfig", value });
|
|
|
|
}
|
|
|
|
}
|