mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-07-25 01:15:26 +10:00
fix(webkit): fix issue with webkit not supporting .at()
This commit is contained in:
@@ -41,14 +41,14 @@ const Section: React.FC<Props> = ({
|
||||
const visibility = useAppSelector<boolean>((state) => get(state.resume, `${path}.visible`, true));
|
||||
|
||||
const handleAdd = () => {
|
||||
const id = path ? (path.split('.').at(-1) as string) : '';
|
||||
const id = path.split('.')[1];
|
||||
const modal: ModalName = validate(id) ? 'builder.sections.custom' : `builder.${path}`;
|
||||
|
||||
dispatch(setModalState({ modal, state: { open: true, payload: { path } } }));
|
||||
};
|
||||
|
||||
const handleEdit = (item: ListItem) => {
|
||||
const id = path ? (path.split('.').at(-1) as string) : '';
|
||||
const id = path.split('.')[1];
|
||||
const modal: ModalName = validate(id) ? 'builder.sections.custom' : `builder.${path}`;
|
||||
const payload = validate(id) ? { path, item } : { item };
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ const Heading: React.FC<Props> = ({
|
||||
|
||||
const [editMode, setEditMode] = useState(false);
|
||||
|
||||
const id = useMemo(() => (path ? path.split('.').at(-1) : ''), [path]);
|
||||
const id = useMemo(() => path.split('.')[1], [path]);
|
||||
|
||||
const icon = sections.find((x) => x.id === id)?.icon || <Grade />;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user