fix: code review #29

https://github.com/Crossbell-Box/xLog/pull/29
This commit is contained in:
qfdk
2022-10-17 08:56:21 +02:00
parent bc0630ce85
commit c39832a6c9
5 changed files with 5 additions and 13 deletions
+1 -9
View File
@@ -148,15 +148,7 @@ export default function SubdomainEditor() {
toast.error("Error: " + createOrUpdatePage.data?.message)
}
}
}, [
createOrUpdatePage,
draftKey,
isPost,
queryClient,
router,
subdomain,
values.published,
])
}, [createOrUpdatePage.isSuccess])
const handleDropFile = useCallback(
async (file: File, view: EditorView) => {
@@ -34,7 +34,7 @@ export default function SettingsDomainsPage() {
} else if (updateSite.isError) {
toast.error("Failed to update site")
}
}, [updateSite.isSuccess, updateSite.isError, updateSite.data])
}, [updateSite.isSuccess, updateSite.isError])
const [hasSet, setHasSet] = useState(false)
useEffect(() => {
@@ -45,7 +45,7 @@ export default function SiteSettingsGeneralPage() {
} else if (updateSite.isError) {
toast.error("Failed to update site")
}
}, [updateSite.isSuccess, updateSite.isError, updateSite.data])
}, [updateSite.isSuccess, updateSite.isError])
useEffect(() => {
if (site.data) {
@@ -113,7 +113,7 @@ export default function SiteSettingsNavigationPage() {
} else if (updateSite.isError) {
toast.error("Failed to save")
}
}, [updateSite.isSuccess, updateSite.isError, updateSite.data])
}, [updateSite.isSuccess, updateSite.isError])
const removeItem: RemoveItem = (id) => {
setItems((items) => items.filter((item) => item.id !== id))
+1 -1
View File
@@ -6,7 +6,7 @@ export const fetchGetPage = async (
input: Parameters<typeof pageModel.getPage>[0],
queryClient: QueryClient,
) => {
const key = ["getPage", input.page]
const key = ["getPage", input.site, input.page]
return await queryClient.fetchQuery(key, async () => {
return cacheGet(key, () => pageModel.getPage(input))
})