fix: action does not take effect after saving

close #1600
This commit is contained in:
Stephen Zhou
2024-11-18 12:13:25 +08:00
parent 8b9750da12
commit c27665df92
2 changed files with 7 additions and 0 deletions
@@ -9,6 +9,7 @@ import { toast } from "sonner"
import { useAuthQuery } from "~/hooks/common"
import { apiClient } from "~/lib/api-fetch"
import { toastFetchError } from "~/lib/error-parser"
import { queryClient } from "~/lib/query-client"
import { ActionCard } from "~/modules/settings/action-card"
import { Queries } from "~/queries"
@@ -57,6 +58,9 @@ export const ActionSetting = () => {
},
onSuccess: () => {
Queries.action.getAll().invalidate()
queryClient.invalidateQueries({
queryKey: ["entries"],
})
toast(t("actions.saveSuccess"))
},
onError: (error) => {
+3
View File
@@ -256,6 +256,9 @@ class EntryActions {
state.flatMapEntries[item.entries.id]?.entries || {},
item.entries,
)
if (item.settings) {
draft.flatMapEntries[item.entries.id].settings = item.settings
}
// Is related to feed
if (item.feeds) {