2020-01-02 20:41:52 +00:00
|
|
|
import storage from "../localStorage";
|
|
|
|
|
|
|
|
export default (network, isCollapsed) => {
|
2022-08-23 07:26:07 +00:00
|
|
|
const stored = storage.get("thelounge.networks.collapsed");
|
|
|
|
const networks = stored ? new Set(JSON.parse(stored)) : new Set();
|
|
|
|
|
2020-01-02 20:41:52 +00:00
|
|
|
network.isCollapsed = isCollapsed;
|
|
|
|
|
|
|
|
if (isCollapsed) {
|
|
|
|
networks.add(network.uuid);
|
|
|
|
} else {
|
|
|
|
networks.delete(network.uuid);
|
|
|
|
}
|
|
|
|
|
|
|
|
storage.set("thelounge.networks.collapsed", JSON.stringify([...networks]));
|
|
|
|
};
|