refactor(ui): clean code
This commit is contained in:
@@ -15,7 +15,8 @@ import { ClientResponseError } from "pocketbase";
|
||||
import AccessEditModal from "@/components/access/AccessEditModal";
|
||||
import { type AccessModel } from "@/domain/access";
|
||||
import { accessProvidersMap } from "@/domain/provider";
|
||||
import { useAccessStore } from "@/stores/access";
|
||||
import { useZustandShallowSelector } from "@/hooks";
|
||||
import { useAccessesStore } from "@/stores/access";
|
||||
import { getErrMsg } from "@/utils/error";
|
||||
|
||||
const AccessList = () => {
|
||||
@@ -24,7 +25,9 @@ const AccessList = () => {
|
||||
const [modalApi, ModelContextHolder] = Modal.useModal();
|
||||
const [notificationApi, NotificationContextHolder] = notification.useNotification();
|
||||
|
||||
const { accesses, loadedAtOnce, fetchAccesses, deleteAccess } = useAccessStore();
|
||||
const { accesses, loadedAtOnce, fetchAccesses, deleteAccess } = useAccessesStore(
|
||||
useZustandShallowSelector(["accesses", "loadedAtOnce", "fetchAccesses", "deleteAccess"])
|
||||
);
|
||||
|
||||
const tableColumns: TableProps<AccessModel>["columns"] = [
|
||||
{
|
||||
|
||||
@@ -3,12 +3,13 @@ import { Card, Divider } from "antd";
|
||||
|
||||
import NotifyChannels from "@/components/notification/NotifyChannels";
|
||||
import NotifyTemplate from "@/components/notification/NotifyTemplate";
|
||||
import { useNotifyChannelStore } from "@/stores/notify";
|
||||
import { useZustandShallowSelector } from "@/hooks";
|
||||
import { useNotifyChannelsStore } from "@/stores/notify";
|
||||
|
||||
const SettingsNotification = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const { loadedAtOnce } = useNotifyChannelStore();
|
||||
const { loadedAtOnce } = useNotifyChannelsStore(useZustandShallowSelector(["loadedAtOnce"]));
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user