mirror of
https://github.com/thelounge/thelounge
synced 2024-11-22 20:13:07 +00:00
117c5fa3fd
* Added client type checking * Fixed client-side typescript issues
16 lines
427 B
TypeScript
16 lines
427 B
TypeScript
import storage from "../localStorage";
|
|
|
|
export default (network, isCollapsed) => {
|
|
const stored = storage.get("thelounge.networks.collapsed");
|
|
const networks = stored ? new Set(JSON.parse(stored)) : new Set();
|
|
|
|
network.isCollapsed = isCollapsed;
|
|
|
|
if (isCollapsed) {
|
|
networks.add(network.uuid);
|
|
} else {
|
|
networks.delete(network.uuid);
|
|
}
|
|
|
|
storage.set("thelounge.networks.collapsed", JSON.stringify([...networks]));
|
|
};
|