mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-08 20:38:17 +00:00
fix
This commit is contained in:
@@ -127,7 +127,6 @@ export default function TabPowerOfAttorney({
|
|||||||
// Save submits the file and the fields together, into one change request.
|
// Save submits the file and the fields together, into one change request.
|
||||||
const [pickedFile, setPickedFile] = useState<File | null>(null);
|
const [pickedFile, setPickedFile] = useState<File | null>(null);
|
||||||
const [removeIds, setRemoveIds] = useState<string[]>([]);
|
const [removeIds, setRemoveIds] = useState<string[]>([]);
|
||||||
const [letterError, setLetterError] = useState<string | null>(null);
|
|
||||||
const [saveBlocked, setSaveBlocked] = useState(false);
|
const [saveBlocked, setSaveBlocked] = useState(false);
|
||||||
|
|
||||||
/** Letters that will still be on file once the staged edits are applied. */
|
/** Letters that will still be on file once the staged edits are applied. */
|
||||||
@@ -176,7 +175,6 @@ export default function TabPowerOfAttorney({
|
|||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
setPickedFile(null);
|
setPickedFile(null);
|
||||||
setRemoveIds([]);
|
setRemoveIds([]);
|
||||||
setLetterError(null);
|
|
||||||
queryClient.invalidateQueries({
|
queryClient.invalidateQueries({
|
||||||
queryKey: api.companies.poaDelegation.queryKey(),
|
queryKey: api.companies.poaDelegation.queryKey(),
|
||||||
});
|
});
|
||||||
@@ -203,13 +201,14 @@ export default function TabPowerOfAttorney({
|
|||||||
setPickedFile(null);
|
setPickedFile(null);
|
||||||
setRemoveIds([]);
|
setRemoveIds([]);
|
||||||
setSaveBlocked(false);
|
setSaveBlocked(false);
|
||||||
setLetterError(null);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const pickFile = (file: File) => {
|
const pickFile = (file: File) => {
|
||||||
setLetterError(null);
|
|
||||||
setSaveBlocked(false);
|
setSaveBlocked(false);
|
||||||
setPickedFile(file);
|
setPickedFile(file);
|
||||||
|
// An upload already supersedes every letter on file, so a pending explicit
|
||||||
|
// removal would be a no-op — drop it rather than mislabel the row.
|
||||||
|
setRemoveIds([]);
|
||||||
};
|
};
|
||||||
|
|
||||||
const toggleRemove = (fileId: string) => {
|
const toggleRemove = (fileId: string) => {
|
||||||
@@ -419,15 +418,6 @@ export default function TabPowerOfAttorney({
|
|||||||
</Text>
|
</Text>
|
||||||
</Group>
|
</Group>
|
||||||
)}
|
)}
|
||||||
{letterError && (
|
|
||||||
<Group gap={6} c="red">
|
|
||||||
<XCircle size={13} />
|
|
||||||
<Text size="xs" fw={500}>
|
|
||||||
{letterError}
|
|
||||||
</Text>
|
|
||||||
</Group>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<input
|
<input
|
||||||
ref={uploadInputRef}
|
ref={uploadInputRef}
|
||||||
type="file"
|
type="file"
|
||||||
|
|||||||
Reference in New Issue
Block a user