mirror of
https://github.com/vxcontrol/pentagi.git
synced 2026-08-26 04:56:36 +00:00
fix(api-tokens): clear the table filter when opening the create row
The inline "Create Token" row is a data row prepended at index 0, so an active
table filter (globalFilterFn) or a non-first page hid it — clicking Create Token
appeared to do nothing. handleCreateNew now calls setFilter(''), which clears the
filter and resets pageIndex to 0 (clearPageOnFilterChange default), so the create
row is always visible.
Live-verified (docker/HEAD backend): with a non-matching filter, Create Token now
shows the create row and clears the filter.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
bbdbdb8666
commit
44b5fef6dc
@@ -371,7 +371,10 @@ function SettingsAPITokens() {
|
||||
const handleCreateNew = useCallback(() => {
|
||||
setCreatingToken(true);
|
||||
createForm.reset(CREATE_TOKEN_DEFAULTS);
|
||||
}, [createForm]);
|
||||
// The create row is prepended at data index 0, so an active filter or a non-first
|
||||
// page would hide it. Clearing the filter also resets pageIndex to 0.
|
||||
setFilter('');
|
||||
}, [createForm, setFilter]);
|
||||
|
||||
const handleCancelCreate = useCallback(() => {
|
||||
setCreatingToken(false);
|
||||
|
||||
Reference in New Issue
Block a user