feat: add anonymous mode toggle to hide reading progress and tracking
Adds a toggleable anonymous mode (eye icon in header) that: - Stops syncing read progress to the server while reading - Hides mark as read/unread buttons on book covers and lists - Hides reading status badges on series and books - Hides progress bars on series and book covers - Hides "continue reading" and "continue series" sections on home - Persists the setting server-side in user preferences (anonymousMode) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -64,6 +64,7 @@ model Preferences {
|
|||||||
displayMode Json
|
displayMode Json
|
||||||
background Json
|
background Json
|
||||||
readerPrefetchCount Int @default(5)
|
readerPrefetchCount Int @default(5)
|
||||||
|
anonymousMode Boolean @default(false)
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
updatedAt DateTime @updatedAt
|
updatedAt DateTime @updatedAt
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { cn } from "@/lib/utils";
|
|||||||
import ClientLayout from "@/components/layout/ClientLayout";
|
import ClientLayout from "@/components/layout/ClientLayout";
|
||||||
import { PreferencesService } from "@/lib/services/preferences.service";
|
import { PreferencesService } from "@/lib/services/preferences.service";
|
||||||
import { PreferencesProvider } from "@/contexts/PreferencesContext";
|
import { PreferencesProvider } from "@/contexts/PreferencesContext";
|
||||||
|
import { AnonymousProvider } from "@/contexts/AnonymousContext";
|
||||||
import { I18nProvider } from "@/components/providers/I18nProvider";
|
import { I18nProvider } from "@/components/providers/I18nProvider";
|
||||||
import { AuthProvider } from "@/components/providers/AuthProvider";
|
import { AuthProvider } from "@/components/providers/AuthProvider";
|
||||||
import { cookies, headers } from "next/headers";
|
import { cookies, headers } from "next/headers";
|
||||||
@@ -313,13 +314,15 @@ export default async function RootLayout({ children }: { children: React.ReactNo
|
|||||||
<AuthProvider>
|
<AuthProvider>
|
||||||
<I18nProvider locale={locale}>
|
<I18nProvider locale={locale}>
|
||||||
<PreferencesProvider initialPreferences={preferences}>
|
<PreferencesProvider initialPreferences={preferences}>
|
||||||
<ClientLayout
|
<AnonymousProvider>
|
||||||
initialLibraries={libraries}
|
<ClientLayout
|
||||||
initialFavorites={favorites}
|
initialLibraries={libraries}
|
||||||
userIsAdmin={userIsAdmin}
|
initialFavorites={favorites}
|
||||||
>
|
userIsAdmin={userIsAdmin}
|
||||||
{children}
|
>
|
||||||
</ClientLayout>
|
{children}
|
||||||
|
</ClientLayout>
|
||||||
|
</AnonymousProvider>
|
||||||
</PreferencesProvider>
|
</PreferencesProvider>
|
||||||
</I18nProvider>
|
</I18nProvider>
|
||||||
</AuthProvider>
|
</AuthProvider>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { ErrorMessage } from "@/components/ui/ErrorMessage";
|
|||||||
import { ERROR_CODES } from "@/constants/errorCodes";
|
import { ERROR_CODES } from "@/constants/errorCodes";
|
||||||
import { AppError } from "@/utils/errors";
|
import { AppError } from "@/utils/errors";
|
||||||
import { FavoritesService } from "@/lib/services/favorites.service";
|
import { FavoritesService } from "@/lib/services/favorites.service";
|
||||||
|
import { PreferencesService } from "@/lib/services/preferences.service";
|
||||||
import { redirect } from "next/navigation";
|
import { redirect } from "next/navigation";
|
||||||
|
|
||||||
export default async function HomePage() {
|
export default async function HomePage() {
|
||||||
@@ -12,16 +13,17 @@ export default async function HomePage() {
|
|||||||
const provider = await getProvider();
|
const provider = await getProvider();
|
||||||
if (!provider) redirect("/settings");
|
if (!provider) redirect("/settings");
|
||||||
|
|
||||||
const [homeData, favorites] = await Promise.all([
|
const [homeData, favorites, preferences] = await Promise.all([
|
||||||
provider.getHomeData(),
|
provider.getHomeData(),
|
||||||
FavoritesService.getFavorites(),
|
FavoritesService.getFavorites(),
|
||||||
|
PreferencesService.getPreferences().catch(() => null),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const data = { ...homeData, favorites };
|
const data = { ...homeData, favorites };
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HomeClientWrapper>
|
<HomeClientWrapper>
|
||||||
<HomeContent data={data} />
|
<HomeContent data={data} isAnonymous={preferences?.anonymousMode ?? false} />
|
||||||
</HomeClientWrapper>
|
</HomeClientWrapper>
|
||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -3,9 +3,10 @@ import type { HomeData } from "@/types/home";
|
|||||||
|
|
||||||
interface HomeContentProps {
|
interface HomeContentProps {
|
||||||
data: HomeData;
|
data: HomeData;
|
||||||
|
isAnonymous?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function HomeContent({ data }: HomeContentProps) {
|
export function HomeContent({ data, isAnonymous = false }: HomeContentProps) {
|
||||||
// Merge onDeck (next unread per series) and ongoingBooks (currently reading),
|
// Merge onDeck (next unread per series) and ongoingBooks (currently reading),
|
||||||
// deduplicate by id, onDeck first
|
// deduplicate by id, onDeck first
|
||||||
const continueReading = (() => {
|
const continueReading = (() => {
|
||||||
@@ -20,7 +21,7 @@ export function HomeContent({ data }: HomeContentProps) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="space-y-10 pb-2">
|
<div className="space-y-10 pb-2">
|
||||||
{continueReading.length > 0 && (
|
{!isAnonymous && continueReading.length > 0 && (
|
||||||
<MediaRow
|
<MediaRow
|
||||||
titleKey="home.sections.continue_reading"
|
titleKey="home.sections.continue_reading"
|
||||||
items={continueReading}
|
items={continueReading}
|
||||||
@@ -29,7 +30,7 @@ export function HomeContent({ data }: HomeContentProps) {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{data.ongoing && data.ongoing.length > 0 && (
|
{!isAnonymous && data.ongoing && data.ongoing.length > 0 && (
|
||||||
<MediaRow
|
<MediaRow
|
||||||
titleKey="home.sections.continue_series"
|
titleKey="home.sections.continue_series"
|
||||||
items={data.ongoing}
|
items={data.ongoing}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import { History, Sparkles, Clock, LibraryBig, BookOpen, Heart } from "lucide-re
|
|||||||
import { Card } from "@/components/ui/card";
|
import { Card } from "@/components/ui/card";
|
||||||
import { useBookOfflineStatus } from "@/hooks/useBookOfflineStatus";
|
import { useBookOfflineStatus } from "@/hooks/useBookOfflineStatus";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
|
import { useAnonymous } from "@/contexts/AnonymousContext";
|
||||||
|
|
||||||
interface MediaRowProps {
|
interface MediaRowProps {
|
||||||
titleKey: string;
|
titleKey: string;
|
||||||
@@ -78,6 +79,7 @@ interface MediaCardProps {
|
|||||||
|
|
||||||
function MediaCard({ item, onClick }: MediaCardProps) {
|
function MediaCard({ item, onClick }: MediaCardProps) {
|
||||||
const { t } = useTranslate();
|
const { t } = useTranslate();
|
||||||
|
const { isAnonymous } = useAnonymous();
|
||||||
const isSeriesItem = isSeries(item);
|
const isSeriesItem = isSeries(item);
|
||||||
const { isAccessible } = useBookOfflineStatus(isSeriesItem ? "" : item.id);
|
const { isAccessible } = useBookOfflineStatus(isSeriesItem ? "" : item.id);
|
||||||
|
|
||||||
@@ -105,7 +107,7 @@ function MediaCard({ item, onClick }: MediaCardProps) {
|
|||||||
<div className="relative aspect-[2/3] bg-muted">
|
<div className="relative aspect-[2/3] bg-muted">
|
||||||
{isSeriesItem ? (
|
{isSeriesItem ? (
|
||||||
<>
|
<>
|
||||||
<SeriesCover series={item} alt={`Couverture de ${title}`} />
|
<SeriesCover series={item} alt={`Couverture de ${title}`} isAnonymous={isAnonymous} />
|
||||||
<div className="absolute inset-0 flex flex-col justify-end bg-gradient-to-t from-black/75 via-black/30 to-transparent p-3 opacity-0 transition-opacity duration-200 hover:opacity-100">
|
<div className="absolute inset-0 flex flex-col justify-end bg-gradient-to-t from-black/75 via-black/30 to-transparent p-3 opacity-0 transition-opacity duration-200 hover:opacity-100">
|
||||||
<h3 className="font-medium text-sm text-white line-clamp-2">{title}</h3>
|
<h3 className="font-medium text-sm text-white line-clamp-2">{title}</h3>
|
||||||
<p className="text-xs text-white/80 mt-1">
|
<p className="text-xs text-white/80 mt-1">
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import { Menu, Moon, Sun, RefreshCw, Search } from "lucide-react";
|
import { Menu, Moon, Sun, RefreshCw, Search, EyeOff, Eye } from "lucide-react";
|
||||||
import { useTheme } from "next-themes";
|
import { useTheme } from "next-themes";
|
||||||
import LanguageSelector from "@/components/LanguageSelector";
|
import LanguageSelector from "@/components/LanguageSelector";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { IconButton } from "@/components/ui/icon-button";
|
import { IconButton } from "@/components/ui/icon-button";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { GlobalSearch } from "@/components/layout/GlobalSearch";
|
import { GlobalSearch } from "@/components/layout/GlobalSearch";
|
||||||
|
import { useAnonymous } from "@/contexts/AnonymousContext";
|
||||||
|
|
||||||
interface HeaderProps {
|
interface HeaderProps {
|
||||||
onToggleSidebar: () => void;
|
onToggleSidebar: () => void;
|
||||||
@@ -19,6 +20,7 @@ export function Header({
|
|||||||
}: HeaderProps) {
|
}: HeaderProps) {
|
||||||
const { theme, setTheme } = useTheme();
|
const { theme, setTheme } = useTheme();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const { isAnonymous, toggleAnonymous } = useAnonymous();
|
||||||
const [isRefreshing, setIsRefreshing] = useState(false);
|
const [isRefreshing, setIsRefreshing] = useState(false);
|
||||||
const [isMobileSearchOpen, setIsMobileSearchOpen] = useState(false);
|
const [isMobileSearchOpen, setIsMobileSearchOpen] = useState(false);
|
||||||
|
|
||||||
@@ -87,6 +89,14 @@ export function Header({
|
|||||||
className="h-9 w-9 rounded-full sm:hidden"
|
className="h-9 w-9 rounded-full sm:hidden"
|
||||||
tooltip={t("header.search.placeholder")}
|
tooltip={t("header.search.placeholder")}
|
||||||
/>
|
/>
|
||||||
|
<IconButton
|
||||||
|
onClick={toggleAnonymous}
|
||||||
|
variant="ghost"
|
||||||
|
size="icon"
|
||||||
|
icon={isAnonymous ? EyeOff : Eye}
|
||||||
|
className={`h-9 w-9 rounded-full ${isAnonymous ? "text-yellow-500 hover:text-yellow-400" : ""}`}
|
||||||
|
tooltip={t(isAnonymous ? "header.anonymousModeOn" : "header.anonymousModeOff")}
|
||||||
|
/>
|
||||||
<LanguageSelector />
|
<LanguageSelector />
|
||||||
<button
|
<button
|
||||||
onClick={toggleTheme}
|
onClick={toggleTheme}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { useRouter } from "next/navigation";
|
|||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
import { SeriesCover } from "@/components/ui/series-cover";
|
import { SeriesCover } from "@/components/ui/series-cover";
|
||||||
import { useTranslate } from "@/hooks/useTranslate";
|
import { useTranslate } from "@/hooks/useTranslate";
|
||||||
|
import { useAnonymous } from "@/contexts/AnonymousContext";
|
||||||
|
|
||||||
interface SeriesGridProps {
|
interface SeriesGridProps {
|
||||||
series: NormalizedSeries[];
|
series: NormalizedSeries[];
|
||||||
@@ -49,6 +50,7 @@ const getReadingStatusInfo = (
|
|||||||
export function SeriesGrid({ series, isCompact = false }: SeriesGridProps) {
|
export function SeriesGrid({ series, isCompact = false }: SeriesGridProps) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { t } = useTranslate();
|
const { t } = useTranslate();
|
||||||
|
const { isAnonymous } = useAnonymous();
|
||||||
|
|
||||||
if (!series.length) {
|
if (!series.length) {
|
||||||
return (
|
return (
|
||||||
@@ -73,24 +75,27 @@ export function SeriesGrid({ series, isCompact = false }: SeriesGridProps) {
|
|||||||
onClick={() => router.push(`/series/${seriesItem.id}`)}
|
onClick={() => router.push(`/series/${seriesItem.id}`)}
|
||||||
className={cn(
|
className={cn(
|
||||||
"group relative aspect-[2/3] overflow-hidden rounded-xl border border-border/60 bg-card/80 shadow-sm transition-all duration-200 hover:-translate-y-0.5 hover:shadow-md",
|
"group relative aspect-[2/3] overflow-hidden rounded-xl border border-border/60 bg-card/80 shadow-sm transition-all duration-200 hover:-translate-y-0.5 hover:shadow-md",
|
||||||
seriesItem.bookCount === seriesItem.booksReadCount && "opacity-50",
|
!isAnonymous && seriesItem.bookCount === seriesItem.booksReadCount && "opacity-50",
|
||||||
isCompact && "aspect-[3/4]"
|
isCompact && "aspect-[3/4]"
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<SeriesCover
|
<SeriesCover
|
||||||
series={seriesItem}
|
series={seriesItem}
|
||||||
alt={t("series.coverAlt", { title: seriesItem.name })}
|
alt={t("series.coverAlt", { title: seriesItem.name })}
|
||||||
|
isAnonymous={isAnonymous}
|
||||||
/>
|
/>
|
||||||
<div className="absolute inset-x-0 bottom-0 translate-y-full space-y-2 bg-gradient-to-t from-black/75 via-black/25 to-transparent p-4 transition-transform duration-200 group-hover:translate-y-0">
|
<div className="absolute inset-x-0 bottom-0 translate-y-full space-y-2 bg-gradient-to-t from-black/75 via-black/25 to-transparent p-4 transition-transform duration-200 group-hover:translate-y-0">
|
||||||
<h3 className="font-medium text-sm text-white line-clamp-2">{seriesItem.name}</h3>
|
<h3 className="font-medium text-sm text-white line-clamp-2">{seriesItem.name}</h3>
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<span
|
{!isAnonymous && (
|
||||||
className={`px-2 py-0.5 rounded-full text-xs ${
|
<span
|
||||||
getReadingStatusInfo(seriesItem, t).className
|
className={`px-2 py-0.5 rounded-full text-xs ${
|
||||||
}`}
|
getReadingStatusInfo(seriesItem, t).className
|
||||||
>
|
}`}
|
||||||
{getReadingStatusInfo(seriesItem, t).label}
|
>
|
||||||
</span>
|
{getReadingStatusInfo(seriesItem, t).label}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
<span className="text-xs text-white/80">
|
<span className="text-xs text-white/80">
|
||||||
{t("series.books", { count: seriesItem.bookCount })}
|
{t("series.books", { count: seriesItem.bookCount })}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { cn } from "@/lib/utils";
|
|||||||
import { Progress } from "@/components/ui/progress";
|
import { Progress } from "@/components/ui/progress";
|
||||||
import { BookOpen, Calendar, Tag, User } from "lucide-react";
|
import { BookOpen, Calendar, Tag, User } from "lucide-react";
|
||||||
import { formatDate } from "@/lib/utils";
|
import { formatDate } from "@/lib/utils";
|
||||||
|
import { useAnonymous } from "@/contexts/AnonymousContext";
|
||||||
|
|
||||||
interface SeriesListProps {
|
interface SeriesListProps {
|
||||||
series: NormalizedSeries[];
|
series: NormalizedSeries[];
|
||||||
@@ -57,16 +58,17 @@ const getReadingStatusInfo = (
|
|||||||
function SeriesListItem({ series, isCompact = false }: SeriesListItemProps) {
|
function SeriesListItem({ series, isCompact = false }: SeriesListItemProps) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { t } = useTranslate();
|
const { t } = useTranslate();
|
||||||
|
const { isAnonymous } = useAnonymous();
|
||||||
|
|
||||||
const handleClick = () => {
|
const handleClick = () => {
|
||||||
router.push(`/series/${series.id}`);
|
router.push(`/series/${series.id}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
const isCompleted = series.bookCount === series.booksReadCount;
|
const isCompleted = isAnonymous ? false : series.bookCount === series.booksReadCount;
|
||||||
const progressPercentage =
|
const progressPercentage =
|
||||||
series.bookCount > 0 ? (series.booksReadCount / series.bookCount) * 100 : 0;
|
series.bookCount > 0 ? (series.booksReadCount / series.bookCount) * 100 : 0;
|
||||||
|
|
||||||
const statusInfo = getReadingStatusInfo(series, t);
|
const statusInfo = isAnonymous ? null : getReadingStatusInfo(series, t);
|
||||||
|
|
||||||
if (isCompact) {
|
if (isCompact) {
|
||||||
return (
|
return (
|
||||||
@@ -83,6 +85,7 @@ function SeriesListItem({ series, isCompact = false }: SeriesListItemProps) {
|
|||||||
series={series}
|
series={series}
|
||||||
alt={t("series.coverAlt", { title: series.name })}
|
alt={t("series.coverAlt", { title: series.name })}
|
||||||
className="w-full h-full"
|
className="w-full h-full"
|
||||||
|
isAnonymous={isAnonymous}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -93,14 +96,16 @@ function SeriesListItem({ series, isCompact = false }: SeriesListItemProps) {
|
|||||||
<h3 className="font-medium text-sm sm:text-base line-clamp-1 hover:text-primary transition-colors flex-1 min-w-0">
|
<h3 className="font-medium text-sm sm:text-base line-clamp-1 hover:text-primary transition-colors flex-1 min-w-0">
|
||||||
{series.name}
|
{series.name}
|
||||||
</h3>
|
</h3>
|
||||||
<span
|
{statusInfo && (
|
||||||
className={cn(
|
<span
|
||||||
"px-2 py-0.5 rounded-full text-xs font-medium flex-shrink-0",
|
className={cn(
|
||||||
statusInfo.className
|
"px-2 py-0.5 rounded-full text-xs font-medium flex-shrink-0",
|
||||||
)}
|
statusInfo.className
|
||||||
>
|
)}
|
||||||
{statusInfo.label}
|
>
|
||||||
</span>
|
{statusInfo.label}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Métadonnées minimales */}
|
{/* Métadonnées minimales */}
|
||||||
@@ -139,6 +144,7 @@ function SeriesListItem({ series, isCompact = false }: SeriesListItemProps) {
|
|||||||
series={series}
|
series={series}
|
||||||
alt={t("series.coverAlt", { title: series.name })}
|
alt={t("series.coverAlt", { title: series.name })}
|
||||||
className="w-full h-full"
|
className="w-full h-full"
|
||||||
|
isAnonymous={isAnonymous}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -153,14 +159,16 @@ function SeriesListItem({ series, isCompact = false }: SeriesListItemProps) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Badge de statut */}
|
{/* Badge de statut */}
|
||||||
<span
|
{statusInfo && (
|
||||||
className={cn(
|
<span
|
||||||
"px-2 py-1 rounded-full text-xs font-medium flex-shrink-0",
|
className={cn(
|
||||||
statusInfo.className
|
"px-2 py-1 rounded-full text-xs font-medium flex-shrink-0",
|
||||||
)}
|
statusInfo.className
|
||||||
>
|
)}
|
||||||
{statusInfo.label}
|
>
|
||||||
</span>
|
{statusInfo.label}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Résumé */}
|
{/* Résumé */}
|
||||||
@@ -224,7 +232,7 @@ function SeriesListItem({ series, isCompact = false }: SeriesListItemProps) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Barre de progression */}
|
{/* Barre de progression */}
|
||||||
{series.bookCount > 0 && !isCompleted && series.booksReadCount > 0 && (
|
{!isAnonymous && series.bookCount > 0 && !isCompleted && series.booksReadCount > 0 && (
|
||||||
<div className="space-y-1">
|
<div className="space-y-1">
|
||||||
<Progress value={progressPercentage} className="h-2" />
|
<Progress value={progressPercentage} className="h-2" />
|
||||||
<p className="text-xs text-muted-foreground">
|
<p className="text-xs text-muted-foreground">
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { ClientOfflineBookService } from "@/lib/services/client-offlinebook.serv
|
|||||||
import type { NormalizedBook } from "@/lib/providers/types";
|
import type { NormalizedBook } from "@/lib/providers/types";
|
||||||
import logger from "@/lib/logger";
|
import logger from "@/lib/logger";
|
||||||
import { updateReadProgress } from "@/app/actions/read-progress";
|
import { updateReadProgress } from "@/app/actions/read-progress";
|
||||||
|
import { useAnonymous } from "@/contexts/AnonymousContext";
|
||||||
|
|
||||||
interface UsePageNavigationProps {
|
interface UsePageNavigationProps {
|
||||||
book: NormalizedBook;
|
book: NormalizedBook;
|
||||||
@@ -23,6 +24,13 @@ export function usePageNavigation({
|
|||||||
nextBook,
|
nextBook,
|
||||||
}: UsePageNavigationProps) {
|
}: UsePageNavigationProps) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const { isAnonymous } = useAnonymous();
|
||||||
|
const isAnonymousRef = useRef(isAnonymous);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
isAnonymousRef.current = isAnonymous;
|
||||||
|
}, [isAnonymous]);
|
||||||
|
|
||||||
const [currentPage, setCurrentPage] = useState(() => {
|
const [currentPage, setCurrentPage] = useState(() => {
|
||||||
const saved = ClientOfflineBookService.getCurrentPage(book);
|
const saved = ClientOfflineBookService.getCurrentPage(book);
|
||||||
return saved < 1 ? 1 : saved;
|
return saved < 1 ? 1 : saved;
|
||||||
@@ -48,8 +56,10 @@ export function usePageNavigation({
|
|||||||
async (page: number) => {
|
async (page: number) => {
|
||||||
try {
|
try {
|
||||||
ClientOfflineBookService.setCurrentPage(bookRef.current, page);
|
ClientOfflineBookService.setCurrentPage(bookRef.current, page);
|
||||||
const completed = page === pagesLengthRef.current;
|
if (!isAnonymousRef.current) {
|
||||||
await updateReadProgress(bookRef.current.id, page, completed);
|
const completed = page === pagesLengthRef.current;
|
||||||
|
await updateReadProgress(bookRef.current.id, page, completed);
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error({ err: error }, "Sync error:");
|
logger.error({ err: error }, "Sync error:");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import { FileText } from "lucide-react";
|
|||||||
import { MarkAsReadButton } from "@/components/ui/mark-as-read-button";
|
import { MarkAsReadButton } from "@/components/ui/mark-as-read-button";
|
||||||
import { MarkAsUnreadButton } from "@/components/ui/mark-as-unread-button";
|
import { MarkAsUnreadButton } from "@/components/ui/mark-as-unread-button";
|
||||||
import { BookOfflineButton } from "@/components/ui/book-offline-button";
|
import { BookOfflineButton } from "@/components/ui/book-offline-button";
|
||||||
|
import { useAnonymous } from "@/contexts/AnonymousContext";
|
||||||
|
|
||||||
interface BookListProps {
|
interface BookListProps {
|
||||||
books: NormalizedBook[];
|
books: NormalizedBook[];
|
||||||
@@ -30,6 +31,7 @@ interface BookListItemProps {
|
|||||||
|
|
||||||
function BookListItem({ book, onBookClick, onSuccess, isCompact = false }: BookListItemProps) {
|
function BookListItem({ book, onBookClick, onSuccess, isCompact = false }: BookListItemProps) {
|
||||||
const { t } = useTranslate();
|
const { t } = useTranslate();
|
||||||
|
const { isAnonymous } = useAnonymous();
|
||||||
const { isAccessible } = useBookOfflineStatus(book.id);
|
const { isAccessible } = useBookOfflineStatus(book.id);
|
||||||
|
|
||||||
const handleClick = () => {
|
const handleClick = () => {
|
||||||
@@ -37,9 +39,9 @@ function BookListItem({ book, onBookClick, onSuccess, isCompact = false }: BookL
|
|||||||
onBookClick(book);
|
onBookClick(book);
|
||||||
};
|
};
|
||||||
|
|
||||||
const isRead = book.readProgress?.completed || false;
|
const isRead = isAnonymous ? false : (book.readProgress?.completed || false);
|
||||||
const hasReadProgress = book.readProgress !== null;
|
const hasReadProgress = isAnonymous ? false : book.readProgress !== null;
|
||||||
const currentPage = ClientOfflineBookService.getCurrentPage(book);
|
const currentPage = isAnonymous ? 0 : ClientOfflineBookService.getCurrentPage(book);
|
||||||
const totalPages = book.pageCount;
|
const totalPages = book.pageCount;
|
||||||
const progressPercentage = totalPages > 0 ? (currentPage / totalPages) * 100 : 0;
|
const progressPercentage = totalPages > 0 ? (currentPage / totalPages) * 100 : 0;
|
||||||
|
|
||||||
@@ -118,14 +120,16 @@ function BookListItem({ book, onBookClick, onSuccess, isCompact = false }: BookL
|
|||||||
>
|
>
|
||||||
{title}
|
{title}
|
||||||
</h3>
|
</h3>
|
||||||
<span
|
{!isAnonymous && (
|
||||||
className={cn(
|
<span
|
||||||
"px-2 py-0.5 rounded-full text-xs font-medium flex-shrink-0",
|
className={cn(
|
||||||
statusInfo.className
|
"px-2 py-0.5 rounded-full text-xs font-medium flex-shrink-0",
|
||||||
)}
|
statusInfo.className
|
||||||
>
|
)}
|
||||||
{statusInfo.label}
|
>
|
||||||
</span>
|
{statusInfo.label}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Métadonnées minimales */}
|
{/* Métadonnées minimales */}
|
||||||
@@ -191,14 +195,16 @@ function BookListItem({ book, onBookClick, onSuccess, isCompact = false }: BookL
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Badge de statut */}
|
{/* Badge de statut */}
|
||||||
<span
|
{!isAnonymous && (
|
||||||
className={cn(
|
<span
|
||||||
"px-2 py-1 rounded-full text-xs font-medium flex-shrink-0",
|
className={cn(
|
||||||
statusInfo.className
|
"px-2 py-1 rounded-full text-xs font-medium flex-shrink-0",
|
||||||
)}
|
statusInfo.className
|
||||||
>
|
)}
|
||||||
{statusInfo.label}
|
>
|
||||||
</span>
|
{statusInfo.label}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Métadonnées */}
|
{/* Métadonnées */}
|
||||||
@@ -224,7 +230,7 @@ function BookListItem({ book, onBookClick, onSuccess, isCompact = false }: BookL
|
|||||||
|
|
||||||
{/* Actions */}
|
{/* Actions */}
|
||||||
<div className="flex items-center gap-2 mt-auto pt-2">
|
<div className="flex items-center gap-2 mt-auto pt-2">
|
||||||
{!isRead && (
|
{!isAnonymous && !isRead && (
|
||||||
<MarkAsReadButton
|
<MarkAsReadButton
|
||||||
bookId={book.id}
|
bookId={book.id}
|
||||||
pagesCount={book.pageCount}
|
pagesCount={book.pageCount}
|
||||||
@@ -233,7 +239,7 @@ function BookListItem({ book, onBookClick, onSuccess, isCompact = false }: BookL
|
|||||||
className="text-xs"
|
className="text-xs"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{hasReadProgress && (
|
{!isAnonymous && hasReadProgress && (
|
||||||
<MarkAsUnreadButton
|
<MarkAsUnreadButton
|
||||||
bookId={book.id}
|
bookId={book.id}
|
||||||
onSuccess={() => onSuccess(book, "unread")}
|
onSuccess={() => onSuccess(book, "unread")}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import { StatusBadge } from "@/components/ui/status-badge";
|
|||||||
import { IconButton } from "@/components/ui/icon-button";
|
import { IconButton } from "@/components/ui/icon-button";
|
||||||
import logger from "@/lib/logger";
|
import logger from "@/lib/logger";
|
||||||
import { addToFavorites, removeFromFavorites } from "@/app/actions/favorites";
|
import { addToFavorites, removeFromFavorites } from "@/app/actions/favorites";
|
||||||
|
import { useAnonymous } from "@/contexts/AnonymousContext";
|
||||||
|
|
||||||
interface SeriesHeaderProps {
|
interface SeriesHeaderProps {
|
||||||
series: NormalizedSeries;
|
series: NormalizedSeries;
|
||||||
@@ -23,6 +24,7 @@ interface SeriesHeaderProps {
|
|||||||
|
|
||||||
export const SeriesHeader = ({ series, refreshSeries, initialIsFavorite }: SeriesHeaderProps) => {
|
export const SeriesHeader = ({ series, refreshSeries, initialIsFavorite }: SeriesHeaderProps) => {
|
||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
|
const { isAnonymous } = useAnonymous();
|
||||||
const [isFavorite, setIsFavorite] = useState(initialIsFavorite);
|
const [isFavorite, setIsFavorite] = useState(initialIsFavorite);
|
||||||
const [isDescriptionExpanded, setIsDescriptionExpanded] = useState(false);
|
const [isDescriptionExpanded, setIsDescriptionExpanded] = useState(false);
|
||||||
const { t } = useTranslate();
|
const { t } = useTranslate();
|
||||||
@@ -100,7 +102,7 @@ export const SeriesHeader = ({ series, refreshSeries, initialIsFavorite }: Serie
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const statusInfo = getReadingStatusInfo();
|
const statusInfo = isAnonymous ? null : getReadingStatusInfo();
|
||||||
const authorsText = series.authors?.length
|
const authorsText = series.authors?.length
|
||||||
? series.authors.map((a) => a.name).join(", ")
|
? series.authors.map((a) => a.name).join(", ")
|
||||||
: null;
|
: null;
|
||||||
@@ -152,9 +154,11 @@ export const SeriesHeader = ({ series, refreshSeries, initialIsFavorite }: Serie
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="flex items-center gap-4 mt-4 justify-center md:justify-start flex-wrap">
|
<div className="flex items-center gap-4 mt-4 justify-center md:justify-start flex-wrap">
|
||||||
<StatusBadge status={statusInfo.status} icon={statusInfo.icon}>
|
{statusInfo && (
|
||||||
{statusInfo.label}
|
<StatusBadge status={statusInfo.status} icon={statusInfo.icon}>
|
||||||
</StatusBadge>
|
{statusInfo.label}
|
||||||
|
</StatusBadge>
|
||||||
|
)}
|
||||||
<span className="text-sm text-white/80">
|
<span className="text-sm text-white/80">
|
||||||
{series.bookCount === 1
|
{series.bookCount === 1
|
||||||
? t("series.header.books", { count: series.bookCount })
|
? t("series.header.books", { count: series.bookCount })
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import { useTranslate } from "@/hooks/useTranslate";
|
|||||||
import { formatDate } from "@/lib/utils";
|
import { formatDate } from "@/lib/utils";
|
||||||
import { useBookOfflineStatus } from "@/hooks/useBookOfflineStatus";
|
import { useBookOfflineStatus } from "@/hooks/useBookOfflineStatus";
|
||||||
import { WifiOff } from "lucide-react";
|
import { WifiOff } from "lucide-react";
|
||||||
|
import { useAnonymous } from "@/contexts/AnonymousContext";
|
||||||
|
|
||||||
// Fonction utilitaire pour obtenir les informations de statut de lecture
|
// Fonction utilitaire pour obtenir les informations de statut de lecture
|
||||||
const getReadingStatusInfo = (
|
const getReadingStatusInfo = (
|
||||||
@@ -60,17 +61,18 @@ export function BookCover({
|
|||||||
overlayVariant = "default",
|
overlayVariant = "default",
|
||||||
}: BookCoverProps) {
|
}: BookCoverProps) {
|
||||||
const { t } = useTranslate();
|
const { t } = useTranslate();
|
||||||
|
const { isAnonymous } = useAnonymous();
|
||||||
const { isAccessible } = useBookOfflineStatus(book.id);
|
const { isAccessible } = useBookOfflineStatus(book.id);
|
||||||
|
|
||||||
const isCompleted = book.readProgress?.completed || false;
|
const isCompleted = isAnonymous ? false : (book.readProgress?.completed || false);
|
||||||
|
|
||||||
const currentPage = ClientOfflineBookService.getCurrentPage(book);
|
const currentPage = isAnonymous ? 0 : ClientOfflineBookService.getCurrentPage(book);
|
||||||
const totalPages = book.pageCount;
|
const totalPages = book.pageCount;
|
||||||
const showProgress = Boolean(showProgressUi && totalPages > 0 && currentPage > 0 && !isCompleted);
|
const showProgress = Boolean(!isAnonymous && showProgressUi && totalPages > 0 && currentPage > 0 && !isCompleted);
|
||||||
|
|
||||||
const statusInfo = getReadingStatusInfo(book, t);
|
const statusInfo = isAnonymous ? { label: "", className: "" } : getReadingStatusInfo(book, t);
|
||||||
const isRead = book.readProgress?.completed || false;
|
const isRead = isAnonymous ? false : (book.readProgress?.completed || false);
|
||||||
const hasReadProgress = book.readProgress !== null || currentPage > 0;
|
const hasReadProgress = isAnonymous ? false : (book.readProgress !== null || currentPage > 0);
|
||||||
|
|
||||||
// Détermine si le livre doit être grisé (non accessible hors ligne)
|
// Détermine si le livre doit être grisé (non accessible hors ligne)
|
||||||
const isUnavailable = !isAccessible;
|
const isUnavailable = !isAccessible;
|
||||||
@@ -115,7 +117,7 @@ export function BookCover({
|
|||||||
{showControls && (
|
{showControls && (
|
||||||
// Boutons en haut à droite avec un petit décalage
|
// Boutons en haut à droite avec un petit décalage
|
||||||
<div className="absolute top-2 right-2 pointer-events-auto flex gap-1">
|
<div className="absolute top-2 right-2 pointer-events-auto flex gap-1">
|
||||||
{!isRead && (
|
{!isAnonymous && !isRead && (
|
||||||
<MarkAsReadButton
|
<MarkAsReadButton
|
||||||
bookId={book.id}
|
bookId={book.id}
|
||||||
pagesCount={book.pageCount}
|
pagesCount={book.pageCount}
|
||||||
@@ -124,7 +126,7 @@ export function BookCover({
|
|||||||
className="bg-white/90 hover:bg-white text-black shadow-sm"
|
className="bg-white/90 hover:bg-white text-black shadow-sm"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{hasReadProgress && (
|
{!isAnonymous && hasReadProgress && (
|
||||||
<MarkAsUnreadButton
|
<MarkAsUnreadButton
|
||||||
bookId={book.id}
|
bookId={book.id}
|
||||||
onSuccess={() => handleMarkAsUnread()}
|
onSuccess={() => handleMarkAsUnread()}
|
||||||
@@ -145,11 +147,13 @@ export function BookCover({
|
|||||||
? t("navigation.volume", { number: book.number })
|
? t("navigation.volume", { number: book.number })
|
||||||
: "")}
|
: "")}
|
||||||
</p>
|
</p>
|
||||||
<div className="flex items-center gap-2">
|
{!isAnonymous && (
|
||||||
<span className={`px-2 py-0.5 rounded-full text-xs ${statusInfo.className}`}>
|
<div className="flex items-center gap-2">
|
||||||
{statusInfo.label}
|
<span className={`px-2 py-0.5 rounded-full text-xs ${statusInfo.className}`}>
|
||||||
</span>
|
{statusInfo.label}
|
||||||
</div>
|
</span>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -162,12 +166,14 @@ export function BookCover({
|
|||||||
? t("navigation.volume", { number: book.number })
|
? t("navigation.volume", { number: book.number })
|
||||||
: "")}
|
: "")}
|
||||||
</h3>
|
</h3>
|
||||||
<p className="text-xs text-white/80 mt-1">
|
{!isAnonymous && (
|
||||||
{t("books.status.progress", {
|
<p className="text-xs text-white/80 mt-1">
|
||||||
current: currentPage,
|
{t("books.status.progress", {
|
||||||
total: book.pageCount,
|
current: currentPage,
|
||||||
})}
|
total: book.pageCount,
|
||||||
</p>
|
})}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -18,4 +18,5 @@ export interface BookCoverProps extends BaseCoverProps {
|
|||||||
|
|
||||||
export interface SeriesCoverProps extends BaseCoverProps {
|
export interface SeriesCoverProps extends BaseCoverProps {
|
||||||
series: NormalizedSeries;
|
series: NormalizedSeries;
|
||||||
|
isAnonymous?: boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,12 +7,13 @@ export function SeriesCover({
|
|||||||
alt = "Image de couverture",
|
alt = "Image de couverture",
|
||||||
className,
|
className,
|
||||||
showProgressUi = true,
|
showProgressUi = true,
|
||||||
|
isAnonymous = false,
|
||||||
}: SeriesCoverProps) {
|
}: SeriesCoverProps) {
|
||||||
const isCompleted = series.bookCount === series.booksReadCount;
|
const isCompleted = isAnonymous ? false : series.bookCount === series.booksReadCount;
|
||||||
|
|
||||||
const readBooks = series.booksReadCount;
|
const readBooks = isAnonymous ? 0 : series.booksReadCount;
|
||||||
const totalBooks = series.bookCount;
|
const totalBooks = series.bookCount;
|
||||||
const showProgress = Boolean(showProgressUi && totalBooks > 0 && readBooks > 0 && !isCompleted);
|
const showProgress = Boolean(!isAnonymous && showProgressUi && totalBooks > 0 && readBooks > 0 && !isCompleted);
|
||||||
const missingCount = series.missingCount;
|
const missingCount = series.missingCount;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
34
src/contexts/AnonymousContext.tsx
Normal file
34
src/contexts/AnonymousContext.tsx
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import React, { createContext, useContext, useMemo, useCallback } from "react";
|
||||||
|
import { usePreferences } from "@/contexts/PreferencesContext";
|
||||||
|
|
||||||
|
interface AnonymousContextType {
|
||||||
|
isAnonymous: boolean;
|
||||||
|
toggleAnonymous: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const AnonymousContext = createContext<AnonymousContextType | undefined>(undefined);
|
||||||
|
|
||||||
|
export function AnonymousProvider({ children }: { children: React.ReactNode }) {
|
||||||
|
const { preferences, updatePreferences } = usePreferences();
|
||||||
|
|
||||||
|
const toggleAnonymous = useCallback(() => {
|
||||||
|
updatePreferences({ anonymousMode: !preferences.anonymousMode });
|
||||||
|
}, [preferences.anonymousMode, updatePreferences]);
|
||||||
|
|
||||||
|
const contextValue = useMemo(
|
||||||
|
() => ({ isAnonymous: preferences.anonymousMode, toggleAnonymous }),
|
||||||
|
[preferences.anonymousMode, toggleAnonymous]
|
||||||
|
);
|
||||||
|
|
||||||
|
return <AnonymousContext.Provider value={contextValue}>{children}</AnonymousContext.Provider>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function useAnonymous() {
|
||||||
|
const context = useContext(AnonymousContext);
|
||||||
|
if (context === undefined) {
|
||||||
|
throw new Error("useAnonymous must be used within an AnonymousProvider");
|
||||||
|
}
|
||||||
|
return context;
|
||||||
|
}
|
||||||
@@ -452,6 +452,9 @@
|
|||||||
"header": {
|
"header": {
|
||||||
"toggleSidebar": "Toggle sidebar",
|
"toggleSidebar": "Toggle sidebar",
|
||||||
"toggleTheme": "Toggle theme",
|
"toggleTheme": "Toggle theme",
|
||||||
|
"anonymousMode": "Anonymous mode",
|
||||||
|
"anonymousModeOn": "Anonymous mode enabled",
|
||||||
|
"anonymousModeOff": "Anonymous mode disabled",
|
||||||
"search": {
|
"search": {
|
||||||
"placeholder": "Search series and books...",
|
"placeholder": "Search series and books...",
|
||||||
"empty": "No results",
|
"empty": "No results",
|
||||||
|
|||||||
@@ -450,6 +450,9 @@
|
|||||||
"header": {
|
"header": {
|
||||||
"toggleSidebar": "Afficher/masquer le menu latéral",
|
"toggleSidebar": "Afficher/masquer le menu latéral",
|
||||||
"toggleTheme": "Changer le thème",
|
"toggleTheme": "Changer le thème",
|
||||||
|
"anonymousMode": "Mode anonyme",
|
||||||
|
"anonymousModeOn": "Mode anonyme activé",
|
||||||
|
"anonymousModeOff": "Mode anonyme désactivé",
|
||||||
"search": {
|
"search": {
|
||||||
"placeholder": "Rechercher séries et tomes...",
|
"placeholder": "Rechercher séries et tomes...",
|
||||||
"empty": "Aucun résultat",
|
"empty": "Aucun résultat",
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ export class PreferencesService {
|
|||||||
return {
|
return {
|
||||||
showThumbnails: preferences.showThumbnails,
|
showThumbnails: preferences.showThumbnails,
|
||||||
showOnlyUnread: preferences.showOnlyUnread,
|
showOnlyUnread: preferences.showOnlyUnread,
|
||||||
|
anonymousMode: preferences.anonymousMode,
|
||||||
displayMode: {
|
displayMode: {
|
||||||
...defaultPreferences.displayMode,
|
...defaultPreferences.displayMode,
|
||||||
...displayMode,
|
...displayMode,
|
||||||
@@ -72,6 +73,8 @@ export class PreferencesService {
|
|||||||
}
|
}
|
||||||
if (preferences.readerPrefetchCount !== undefined)
|
if (preferences.readerPrefetchCount !== undefined)
|
||||||
updateData.readerPrefetchCount = preferences.readerPrefetchCount;
|
updateData.readerPrefetchCount = preferences.readerPrefetchCount;
|
||||||
|
if (preferences.anonymousMode !== undefined)
|
||||||
|
updateData.anonymousMode = preferences.anonymousMode;
|
||||||
|
|
||||||
const updatedPreferences = await prisma.preferences.upsert({
|
const updatedPreferences = await prisma.preferences.upsert({
|
||||||
where: { userId },
|
where: { userId },
|
||||||
@@ -80,6 +83,7 @@ export class PreferencesService {
|
|||||||
userId,
|
userId,
|
||||||
showThumbnails: preferences.showThumbnails ?? defaultPreferences.showThumbnails,
|
showThumbnails: preferences.showThumbnails ?? defaultPreferences.showThumbnails,
|
||||||
showOnlyUnread: preferences.showOnlyUnread ?? defaultPreferences.showOnlyUnread,
|
showOnlyUnread: preferences.showOnlyUnread ?? defaultPreferences.showOnlyUnread,
|
||||||
|
anonymousMode: preferences.anonymousMode ?? defaultPreferences.anonymousMode,
|
||||||
displayMode: preferences.displayMode ?? defaultPreferences.displayMode,
|
displayMode: preferences.displayMode ?? defaultPreferences.displayMode,
|
||||||
background: (preferences.background ??
|
background: (preferences.background ??
|
||||||
defaultPreferences.background) as unknown as Prisma.InputJsonValue,
|
defaultPreferences.background) as unknown as Prisma.InputJsonValue,
|
||||||
@@ -90,6 +94,7 @@ export class PreferencesService {
|
|||||||
return {
|
return {
|
||||||
showThumbnails: updatedPreferences.showThumbnails,
|
showThumbnails: updatedPreferences.showThumbnails,
|
||||||
showOnlyUnread: updatedPreferences.showOnlyUnread,
|
showOnlyUnread: updatedPreferences.showOnlyUnread,
|
||||||
|
anonymousMode: updatedPreferences.anonymousMode,
|
||||||
displayMode: updatedPreferences.displayMode as UserPreferences["displayMode"],
|
displayMode: updatedPreferences.displayMode as UserPreferences["displayMode"],
|
||||||
background: {
|
background: {
|
||||||
...defaultPreferences.background,
|
...defaultPreferences.background,
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ export interface BackgroundPreferences {
|
|||||||
export interface UserPreferences {
|
export interface UserPreferences {
|
||||||
showThumbnails: boolean;
|
showThumbnails: boolean;
|
||||||
showOnlyUnread: boolean;
|
showOnlyUnread: boolean;
|
||||||
|
anonymousMode: boolean;
|
||||||
displayMode: {
|
displayMode: {
|
||||||
compact: boolean;
|
compact: boolean;
|
||||||
itemsPerPage: number;
|
itemsPerPage: number;
|
||||||
@@ -24,6 +25,7 @@ export interface UserPreferences {
|
|||||||
export const defaultPreferences: UserPreferences = {
|
export const defaultPreferences: UserPreferences = {
|
||||||
showThumbnails: true,
|
showThumbnails: true,
|
||||||
showOnlyUnread: false,
|
showOnlyUnread: false,
|
||||||
|
anonymousMode: false,
|
||||||
displayMode: {
|
displayMode: {
|
||||||
compact: false,
|
compact: false,
|
||||||
itemsPerPage: 20,
|
itemsPerPage: 20,
|
||||||
|
|||||||
Reference in New Issue
Block a user