Skip to content

Commit

Permalink
Fixed some display text
Browse files Browse the repository at this point in the history
  • Loading branch information
yaoxi-std committed Jan 27, 2025
1 parent 19e6064 commit 79fd9a8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/pages/custom-search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default (db) => {
const [filterCode, setFilterCode] = useState<string>(
localStorage.getItem(STORAGE_KEY) || DEFAULT_EDITOR_CONTENT
);
const [filterError, setFilterError] = useState<string | null>(null);
const [runtimeError, setRuntimeError] = useState<string | null>(null);
const [activeFilter, setActiveFilter] = useState<string>(filterCode);

const [filteredData, setFilteredData] = useState<{
Expand All @@ -50,7 +50,7 @@ export default (db) => {
};

const loadData = async () => {
setFilterError(null);
setRuntimeError(null);

if (!activeFilter.trim()) {
return setFilteredData({ type: 'OIer', result: OIerDb.oiers });
Expand All @@ -75,7 +75,7 @@ export default (db) => {

throw new Error('Unexpected type of return value');
} catch (err) {
setFilterError(err.message);
setRuntimeError(err.message);
return setFilteredData({ type: 'OIer', result: OIerDb.oiers });
}
};
Expand Down Expand Up @@ -108,9 +108,9 @@ export default (db) => {
运行
</Button>

{filterError && (
{runtimeError && (
<div style={{ color: 'red', marginTop: '5px' }}>
过滤器错误:{filterError}
运行时错误:{runtimeError}
</div>
)}
</Segment>
Expand Down

0 comments on commit 79fd9a8

Please sign in to comment.