Skip to content

Commit

Permalink
fix(webkit): fix issue with webkit not supporting .at()
Browse files Browse the repository at this point in the history
  • Loading branch information
AmruthPillai committed Mar 11, 2022
1 parent 7d8828a commit 2654cba
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions client/components/build/LeftSidebar/sections/Section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 };

Expand Down
2 changes: 1 addition & 1 deletion client/components/shared/Heading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 />;

Expand Down
2 changes: 1 addition & 1 deletion client/store/resume/resumeSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const resumeSlice = createSlice({
},
deleteSection: (state: Resume, action: PayloadAction<DeleteSectionPayload>) => {
const { path } = action.payload;
const id = path ? path.split('.').at(-1) : '';
const id = path.split('.')[1];

const sections = Object.keys(state.sections).filter((x) => x !== id);
const layout = state.metadata.layout.map((pages) => pages.map((list) => list.filter((x) => x !== id)));
Expand Down
2 changes: 1 addition & 1 deletion client/utils/getCookie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ export const getCookie = (name: string): string | undefined => {
const parts = value.split(`; ${name}=`);

if (parts.length === 2) {
return parts.at(-1);
return parts[1];
}
};
2 changes: 1 addition & 1 deletion server/src/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export class AuthService {

const UserInfoClient = google.oauth2('v2').userinfo;
const { data } = await UserInfoClient.get({ auth: OAuthClient });
const username = data.email.split('@').at(0);
const username = data.email.split('@')[0];

const createUserDto: CreateGoogleUserDto = {
name: `${data.given_name} ${data.family_name}`,
Expand Down

0 comments on commit 2654cba

Please sign in to comment.