mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
parent
1f5a42d34c
commit
3611e99422
1 changed files with 4 additions and 0 deletions
|
@ -34,6 +34,8 @@ const Sidebar: React.FC<{
|
|||
const [nameLength, setNameLength] = useState(offer?.name.length || 0);
|
||||
const nameLengthColor = nameLength > 40 ? 'text-red' : 'text-green';
|
||||
|
||||
const {updateRoute} = useRouting();
|
||||
|
||||
useEffect(() => {
|
||||
if (offer?.name) {
|
||||
setNameLength(offer?.name.length);
|
||||
|
@ -66,6 +68,7 @@ const Sidebar: React.FC<{
|
|||
type: 'success',
|
||||
message: 'Offer archived successfully'
|
||||
});
|
||||
updateRoute('offers/edit');
|
||||
} catch (e) {
|
||||
handleError(e);
|
||||
}
|
||||
|
@ -86,6 +89,7 @@ const Sidebar: React.FC<{
|
|||
type: 'success',
|
||||
message: 'Offer reactivated successfully'
|
||||
});
|
||||
updateRoute('offers/edit');
|
||||
} catch (e) {
|
||||
handleError(e);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue