refactor: preload license info

This commit is contained in:
Tristan Yang
2023-03-23 13:50:29 +08:00
parent bb37f1b2e6
commit 049f7c75e3
5 changed files with 14 additions and 13 deletions
+1 -3
View File
@@ -12,7 +12,6 @@ import IconInvite from "../../assets/icons/placeholder.invite.svg";
import IconDownload from "../../assets/icons/placeholder.download.svg";
import UsersModal from "./UsersModal";
import { useAppSelector } from "../../app/store";
import useLicense from "../hook/useLicense";
interface Props {
@@ -25,11 +24,10 @@ const classes = {
};
const BlankPlaceholder: FC<Props> = ({ type = "chat" }) => {
const { t } = useTranslation("welcome");
const { server, isAdmin } = useAppSelector((store) => { return { server: store.server, isAdmin: store.authData.user?.is_admin }; });
const { server, isAdmin, upgraded } = useAppSelector((store) => { return { server: store.server, isAdmin: store.authData.user?.is_admin, upgraded: store.server.upgraded }; });
const [inviteModalVisible, setInviteModalVisible] = useState(false);
const [createChannelVisible, setCreateChannelVisible] = useState(false);
const [userListVisible, setUserListVisible] = useState(false);
const { upgraded } = useLicense();
const toggleChannelModalVisible = () => {
setCreateChannelVisible((prev) => !prev);
};