diff --git a/.eslintrc.json b/.eslintrc.json index 42c7b586..81257cb3 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -21,10 +21,6 @@ "@typescript-eslint/explicit-module-boundary-types": 0, "@typescript-eslint/no-empty-function": 0, "arrow-body-style": 0, - "jsx-a11y/anchor-is-valid": 1, - "jsx-a11y/aria-role": 1, - "jsx-a11y/click-events-have-key-events": 1, - "jsx-a11y/no-static-element-interactions": 1, "curly": 0, "eol-last": 0, "eqeqeq": 0, diff --git a/src/assets/css/main.css b/src/assets/css/main.css index dde2a503..d3e9d0b8 100644 --- a/src/assets/css/main.css +++ b/src/assets/css/main.css @@ -84,7 +84,7 @@ margin-top: -6.5px; } -.post-title a:visited { +.post-title a:visited:not(:hover) { color: var(--bs-gray) !important; } diff --git a/src/server/handlers/theme-handler.ts b/src/server/handlers/theme-handler.ts index b107d854..456fb3bd 100644 --- a/src/server/handlers/theme-handler.ts +++ b/src/server/handlers/theme-handler.ts @@ -11,22 +11,21 @@ export default async (req: Request, res: Response) => { const theme = req.params.name; if (!theme.endsWith(".css")) { - res.statusCode = 400; - res.send("Theme must be a css file"); + return res.status(400).send("Theme must be a css file"); } const customTheme = path.resolve(extraThemesFolder, theme); if (existsSync(customTheme)) { - res.sendFile(customTheme); + return res.sendFile(customTheme); } else { const internalTheme = path.resolve(`./dist/assets/css/themes/${theme}`); // If the theme doesn't exist, just send litely if (existsSync(internalTheme)) { - res.sendFile(internalTheme); + return res.sendFile(internalTheme); } else { - res.sendFile(path.resolve("./dist/assets/css/themes/litely.css")); + return res.sendFile(path.resolve("./dist/assets/css/themes/litely.css")); } } }; diff --git a/src/server/middleware/set-default-csp.ts b/src/server/middleware/set-default-csp.ts index a3ee5261..fd776ab6 100644 --- a/src/server/middleware/set-default-csp.ts +++ b/src/server/middleware/set-default-csp.ts @@ -3,7 +3,7 @@ import type { NextFunction, Response } from "express"; export default function ({ res, next }: { res: Response; next: NextFunction }) { res.setHeader( "Content-Security-Policy", - `default-src 'self'; manifest-src *; connect-src *; img-src * data:; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; form-action 'self'; base-uri 'self'; frame-src *; media-src *` + `default-src 'self'; manifest-src *; connect-src *; img-src * data:; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; form-action 'self'; base-uri 'self'; frame-src *; media-src * data:` ); next(); diff --git a/src/shared/components/post/metadata-card.tsx b/src/shared/components/post/metadata-card.tsx index 2d770d44..a1ddca7f 100644 --- a/src/shared/components/post/metadata-card.tsx +++ b/src/shared/components/post/metadata-card.tsx @@ -1,8 +1,7 @@ -import { Component, linkEvent } from "inferno"; +import { Component } from "inferno"; import { Post } from "lemmy-js-client"; import * as sanitizeHtml from "sanitize-html"; import { relTags } from "../../config"; -import { I18NextService } from "../../services"; import { Icon } from "../common/icon"; interface MetadataCardProps { @@ -17,10 +16,6 @@ export class MetadataCard extends Component< MetadataCardProps, MetadataCardState > { - state: MetadataCardState = { - expanded: false, - }; - constructor(props: any, context: any) { super(props, context); } @@ -29,7 +24,7 @@ export class MetadataCard extends Component< const post = this.props.post; return ( <> - {!this.state.expanded && post.embed_title && post.url && ( + {post.embed_title && post.url && (
+