mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-11 13:56:16 +00:00
ci: imports fix, readonly marking, using dialog, removed unnecesary assertions
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import axios from "axios";
|
||||
import { fileTypeFromFile } from "file-type";
|
||||
import { HydraApi } from "@main/services/hydra-api";
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { desktopCapturer, nativeImage } from "electron";
|
||||
import { desktopCapturer, nativeImage, app } from "electron";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { app } from "electron";
|
||||
import { logger } from "./logger";
|
||||
|
||||
export class ScreenshotService {
|
||||
@@ -66,11 +65,11 @@ export class ScreenshotService {
|
||||
let filename: string;
|
||||
|
||||
if (gameTitle && achievementName) {
|
||||
const sanitizedGameTitle = gameTitle.replace(/[<>:"/\\|?*]/g, "_");
|
||||
const sanitizedGameTitle = gameTitle.replaceAll(/[<>:"/\\|?*]/g, "_");
|
||||
const gameDir = path.join(screenshotsDir, sanitizedGameTitle);
|
||||
finalDir = gameDir;
|
||||
|
||||
const sanitizedAchievementName = achievementName.replace(
|
||||
const sanitizedAchievementName = achievementName.replaceAll(
|
||||
/[<>:"/\\|?*]/g,
|
||||
"_"
|
||||
);
|
||||
|
||||
@@ -14,7 +14,7 @@ export function FullscreenImageModal({
|
||||
imageUrl,
|
||||
imageAlt,
|
||||
onClose,
|
||||
}: FullscreenImageModalProps) {
|
||||
}: Readonly<FullscreenImageModalProps>) {
|
||||
useEffect(() => {
|
||||
const handleKeyDown = (event: KeyboardEvent) => {
|
||||
if (event.key === "Escape") {
|
||||
@@ -36,11 +36,10 @@ export function FullscreenImageModal({
|
||||
if (!isOpen) return null;
|
||||
|
||||
return (
|
||||
<div
|
||||
<dialog
|
||||
className="fullscreen-image-modal"
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
tabIndex={-1}
|
||||
open
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
@@ -66,6 +65,6 @@ export function FullscreenImageModal({
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</dialog>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ export function AchievementList({
|
||||
className="achievements__item-image-button"
|
||||
onClick={() =>
|
||||
handleImageClick(
|
||||
achievement.achievementImageUrl!,
|
||||
achievement.achievementImageUrl,
|
||||
achievement.displayName
|
||||
)
|
||||
}
|
||||
|
||||
@@ -230,7 +230,7 @@ export function ProfileContent() {
|
||||
className="profile-content__souvenir-image-button"
|
||||
onClick={() =>
|
||||
handleImageClick(
|
||||
achievement.achievementImageUrl!,
|
||||
achievement.achievementImageUrl,
|
||||
achievement.name
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user