minor fixes

This commit is contained in:
tonyrewin 2022-09-24 17:58:19 +03:00
parent f4c974d1e1
commit f73a834f35
2 changed files with 4 additions and 3 deletions

View File

@ -16,7 +16,8 @@ const getDevCssClassPrefix = (filename: string): string => {
return filename return filename
.slice(filename.indexOf(PATH_PREFIX) + PATH_PREFIX.length) .slice(filename.indexOf(PATH_PREFIX) + PATH_PREFIX.length)
.replace('.module.scss', '') .replace('.module.scss', '')
.replace(/[/\\]/, '-') .replace(/[/?\\]/, '-')
.replace('?', '-')
} }
const devGenerateScopedName = (name: string, filename: string, css: string) => const devGenerateScopedName = (name: string, filename: string, css: string) =>

View File

@ -15,11 +15,11 @@ export const useTopAuthorsStore = () => {
return Object.keys(articlesByAuthor) return Object.keys(articlesByAuthor)
.sort((authorSlug1, authorSlug2) => { .sort((authorSlug1, authorSlug2) => {
const author1Rating = articlesByAuthor[authorSlug1].reduce( const author1Rating = articlesByAuthor[authorSlug1].reduce(
(acc, article) => acc + article.stat.rating, (acc, article) => acc + article.stat?.rating,
0 0
) )
const author2Rating = articlesByAuthor[authorSlug2].reduce( const author2Rating = articlesByAuthor[authorSlug2].reduce(
(acc, article) => acc + article.stat.rating, (acc, article) => acc + article.stat?.rating,
0 0
) )
if (author1Rating === author2Rating) { if (author1Rating === author2Rating) {