Skip to content

Commit

Permalink
Merge pull request #44 from hamachi25:bookmark-mutedfix
Browse files Browse the repository at this point in the history
ブックマークではミュートされないように修正
  • Loading branch information
hamachi25 authored Mar 4, 2025
2 parents b15605b + 6779b41 commit 3a4709c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const FollowingContainer = ({ profiles }: Props) => {
{profile.illusts?.map((illust) => (
<li key={illust.id} className="w-[184px] min-w-[184px]">
<div className="relative">
<GridImage illust={illust} type="following" />
<GridImage illust={illust} />
<BookmarkButton
bookmarkData={illust.bookmarkData}
work={illust}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const GridIllustsContainer = ({ illusts, type }: Props) => {
<div className="relative">
{/* メイン画像 */}
{!illust.maskReason ? (
<GridImage illust={illust} type={type} />
<GridImage illust={illust} />
) : (
// R18・R18G・削除済み
<div className="flex h-[184px] w-[184px] items-center justify-center rounded-[8px] bg-(--charcoal-background2)">
Expand Down
5 changes: 2 additions & 3 deletions src/entrypoints/content/components/ui/GridImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ import { MutedImage } from "../icons/MutedImage";

interface Props {
illust: Work;
type: string;
}

export const GridImage = ({ illust, type }: Props) => {
export const GridImage = ({ illust }: Props) => {
const settings = useContext(SettingContext);
const isSensitive = useContext(SensitiveContext);

Expand All @@ -20,7 +19,7 @@ export const GridImage = ({ illust, type }: Props) => {
target={settings?.openInNewTab ? "_blank" : undefined}
rel="noreferrer"
>
{illust.isMuted && type !== "bookmark" ? (
{illust.isMuted ? (
<div className="flex h-[184px] w-[184px] items-center justify-center rounded-[8px] bg-(--charcoal-background2)">
<div className="-mb-[1px] flex h-[122px] w-[122px] flex-col items-center justify-center gap-[4px] text-(--charcoal-text4) select-none">
<MutedImage className="h-[48px] w-[48px]" />
Expand Down
6 changes: 5 additions & 1 deletion src/entrypoints/content/utils/transformData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ export const transformData = (
illustData = data.body.novel.data;
}

const shouldFilterMuted = muteSettings.tags.length > 0 || muteSettings.users.length > 0;
// ブックマークを除外
const shouldFilterMuted =
(!(PAGE_REGEX.bookmarkIllust.test(pathName) || PAGE_REGEX.bookmarkNovel.test(pathName)) &&
muteSettings.tags.length > 0) ||
muteSettings.users.length > 0;

return (illustData || []).filter(isIllustItem).map((item: Work) => ({
id: item.id,
Expand Down

0 comments on commit 3a4709c

Please sign in to comment.