refactor: preload license info
This commit is contained in:
@@ -27,7 +27,7 @@ const Item = ({ label, data, foldable = false, ...rest }: ItemProps) => {
|
||||
export default function License() {
|
||||
const { t, i18n } = useTranslation("setting");
|
||||
// const { t: ct } = useTranslation();
|
||||
const { license: licenseInfo, reachLimit, upsertLicense, upserting, upserted } = useLicense();
|
||||
const { license: licenseInfo, reachLimit, upsertLicense, upserting, upserted } = useLicense(true);
|
||||
const [modalVisible, setModalVisible] = useState(false);
|
||||
const [updateVisible, setUpdateVisible] = useState(false);
|
||||
const [base58Fold, setBase58Fold] = useState(true);
|
||||
|
||||
@@ -14,7 +14,6 @@ import Version from "../../common/component/Version";
|
||||
// import ConfigAgora from "./config/Agora";
|
||||
import { useAppSelector } from "../../app/store";
|
||||
import ServerVersionChecker from "../../common/component/ServerVersionChecker";
|
||||
import useLicense from "../../common/hook/useLicense";
|
||||
|
||||
const navs = [
|
||||
{
|
||||
@@ -98,10 +97,9 @@ const navs = [
|
||||
];
|
||||
|
||||
const useNavs = () => {
|
||||
const { upgraded } = useLicense();
|
||||
const { t } = useTranslation("setting");
|
||||
const loginUser = useAppSelector((store) => {
|
||||
return store.authData.user;
|
||||
const { loginUser, upgraded } = useAppSelector((store) => {
|
||||
return { loginUser: store.authData.user, upgraded: store.server.upgraded };
|
||||
});
|
||||
const transformedNavs = navs.map(n => {
|
||||
const { name, items, ...rest } = n;
|
||||
|
||||
Reference in New Issue
Block a user