117c5fa3fd
* Added client type checking * Fixed client-side typescript issues
17 lines
427 B
TypeScript
17 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]));
|
|
};
|