fix: clear recovered order load errors without hiding save warnings

This commit is contained in:
sagitchu
2026-11-10 08:26:49 +08:00
parent e35bff8579
commit 5cc91710c9
4 changed files with 42 additions and 24 deletions
+7 -9
View File
@@ -9,6 +9,7 @@ import {
OrderStatus,
} from "@/components/server-order";
import { useServerOrder } from "@/hooks/use-server-order";
import { getOrderDisabledReason } from "@/utils/server-order";
import { isAdmin } from "@/utils/auth";
import { AnimatedPage, StaggerList } from "@/components/animated-page";
import { SearchBar } from "@/components/search-bar";
@@ -216,15 +217,12 @@ export default function LimitPage() {
}
};
const orderReason = !isAdmin()
? "仅管理员可调整全局顺序。"
: searchKeyword.length > 0
? "搜索期间无法排序,请清空搜索后重试。"
: order.saving
? "正在保存顺序,请稍候。"
: loading || submitLoading || deleteLoading
? "正在加载或更新列表,请稍候。"
: "";
const orderReason = getOrderDisabledReason({
isAdmin: isAdmin(),
searchKeyword,
saving: order.saving,
busy: loading || submitLoading || deleteLoading,
});
const orderDisabled = Boolean(orderReason);
return (