diff --git a/apps/desktop/layer/renderer/src/modules/settings/tabs/lists/index.tsx b/apps/desktop/layer/renderer/src/modules/settings/tabs/lists/index.tsx index 834b7e275..c9a35f87a 100644 --- a/apps/desktop/layer/renderer/src/modules/settings/tabs/lists/index.tsx +++ b/apps/desktop/layer/renderer/src/modules/settings/tabs/lists/index.tsx @@ -40,7 +40,6 @@ const ConfirmDestroyModalContent = ({ listId }: { listId: string }) => { mutationFn: (payload: { listId: string }) => listActions.deleteList(payload.listId), onSuccess: () => { toast.success(t.settings("lists.delete.success")) - Queries.lists.list().invalidate() }, onError() { toast.error(t.settings("lists.delete.error")) diff --git a/apps/desktop/layer/renderer/src/modules/subscription-column/SubscriptionList.electron.tsx b/apps/desktop/layer/renderer/src/modules/subscription-column/SubscriptionList.electron.tsx index d97310a14..beaae30bc 100644 --- a/apps/desktop/layer/renderer/src/modules/subscription-column/SubscriptionList.electron.tsx +++ b/apps/desktop/layer/renderer/src/modules/subscription-column/SubscriptionList.electron.tsx @@ -58,8 +58,8 @@ const SubscriptionImpl = ({ ref, className, view }: SubscriptionProps) => { // Data prefetch useAuthQuery(Queries.lists.list()) - const hasListData = Object.keys(listSubIds).length > 0 - const hasInboxData = Object.keys(inboxSubIds).length > 0 + const hasListData = listSubIds.length > 0 + const hasInboxData = inboxSubIds.length > 0 const scrollerRef = useRef(null) const selectoRef = useRef(null) diff --git a/apps/desktop/layer/renderer/src/modules/subscription-column/SubscriptionList.mobile.tsx b/apps/desktop/layer/renderer/src/modules/subscription-column/SubscriptionList.mobile.tsx index 3ce5d9a3c..2ea5fc2d6 100644 --- a/apps/desktop/layer/renderer/src/modules/subscription-column/SubscriptionList.mobile.tsx +++ b/apps/desktop/layer/renderer/src/modules/subscription-column/SubscriptionList.mobile.tsx @@ -21,22 +21,20 @@ import { EmptyFeedList, ListHeader, StarredItem } from "./SubscriptionList.share const FeedListImpl = ({ className, view }: SubscriptionProps) => { const feedsData = useFeedsGroupedData(view) - const listsData = useSubscriptionListIds(view) - const inboxesData = useSubscriptionInboxIds(view) + const listSubIds = useSubscriptionListIds(view) + const inboxSubIds = useSubscriptionInboxIds(view) const categoryOpenStateData = useCategoryOpenStateByView(view) const hasData = - Object.keys(feedsData).length > 0 || - Object.keys(listsData).length > 0 || - Object.keys(inboxesData).length > 0 + Object.keys(feedsData).length > 0 || listSubIds.length > 0 || inboxSubIds.length > 0 const { t } = useTranslation() // Data prefetch useAuthQuery(Queries.lists.list()) - const hasListData = Object.keys(listsData).length > 0 - const hasInboxData = Object.keys(inboxesData).length > 0 + const hasListData = listSubIds.length > 0 + const hasInboxData = inboxSubIds.length > 0 const currentActiveView = useRouteParamsSelector((s) => s.view) // Render only adjacent views @@ -58,7 +56,7 @@ const FeedListImpl = ({ className, view }: SubscriptionProps) => {
{t("words.lists")}
- + )} {hasInboxData && ( @@ -66,7 +64,7 @@ const FeedListImpl = ({ className, view }: SubscriptionProps) => {
{t("words.inbox")}
- + )} diff --git a/apps/desktop/layer/renderer/src/store/list/store.ts b/apps/desktop/layer/renderer/src/store/list/store.ts index 2f917da5a..019809c1a 100644 --- a/apps/desktop/layer/renderer/src/store/list/store.ts +++ b/apps/desktop/layer/renderer/src/store/list/store.ts @@ -5,7 +5,6 @@ import type { ListModel, ListModelPoplutedFeeds, } from "@follow/models/types" -import { sleep } from "@follow/utils/utils" import { runTransactionInScope } from "~/database" import { apiClient } from "~/lib/api-fetch" @@ -97,8 +96,7 @@ class ListActionStatic { }) }) tx.execute(async () => { - await sleep(1000) - + await subscriptionActions.unfollow([listId]) await apiClient.lists.$delete({ json: { listId,