mirror of
https://github.com/stashapp/stash.git
synced 2025-12-06 16:34:02 +01:00
Fix image title not appearing in lightbox (#5675)
This commit is contained in:
parent
e97f647a43
commit
587fd9e6b8
2 changed files with 6 additions and 3 deletions
|
|
@ -48,6 +48,7 @@ import {
|
||||||
import { RatingSystem } from "src/components/Shared/Rating/RatingSystem";
|
import { RatingSystem } from "src/components/Shared/Rating/RatingSystem";
|
||||||
import { useDebounce } from "../debounce";
|
import { useDebounce } from "../debounce";
|
||||||
import { isVideo } from "src/utils/visualFile";
|
import { isVideo } from "src/utils/visualFile";
|
||||||
|
import { imageTitle } from "src/core/files";
|
||||||
|
|
||||||
const CLASSNAME = "Lightbox";
|
const CLASSNAME = "Lightbox";
|
||||||
const CLASSNAME_HEADER = `${CLASSNAME}-header`;
|
const CLASSNAME_HEADER = `${CLASSNAME}-header`;
|
||||||
|
|
@ -689,6 +690,7 @@ export const LightboxComponent: React.FC<IProps> = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
const currentImage: ILightboxImage | undefined = images[currentIndex];
|
const currentImage: ILightboxImage | undefined = images[currentIndex];
|
||||||
|
const title = currentImage ? imageTitle(currentImage) : undefined;
|
||||||
|
|
||||||
function setRating(v: number | null) {
|
function setRating(v: number | null) {
|
||||||
if (currentImage?.id) {
|
if (currentImage?.id) {
|
||||||
|
|
@ -932,9 +934,9 @@ export const LightboxComponent: React.FC<IProps> = ({
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{currentImage?.title && (
|
{currentImage && (
|
||||||
<Link to={`/images/${currentImage.id}`} onClick={() => close()}>
|
<Link to={`/images/${currentImage.id}`} onClick={() => close()}>
|
||||||
{currentImage.title ?? ""}
|
{title ?? ""}
|
||||||
</Link>
|
</Link>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ interface IImagePaths {
|
||||||
|
|
||||||
interface IFiles {
|
interface IFiles {
|
||||||
__typename?: string;
|
__typename?: string;
|
||||||
|
path: string;
|
||||||
width: number;
|
width: number;
|
||||||
height: number;
|
height: number;
|
||||||
video_codec?: GQL.Maybe<string>;
|
video_codec?: GQL.Maybe<string>;
|
||||||
|
|
@ -19,7 +20,7 @@ export interface ILightboxImage {
|
||||||
rating100?: GQL.Maybe<number>;
|
rating100?: GQL.Maybe<number>;
|
||||||
o_counter?: GQL.Maybe<number>;
|
o_counter?: GQL.Maybe<number>;
|
||||||
paths: IImagePaths;
|
paths: IImagePaths;
|
||||||
visual_files?: GQL.Maybe<IFiles>[];
|
visual_files?: IFiles[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IChapter {
|
export interface IChapter {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue