Rename manga and chapter constants
This commit is contained in:
@@ -19,7 +19,7 @@ import { ComponentProps, useMemo } from 'react';
|
||||
import LaunchIcon from '@mui/icons-material/Launch';
|
||||
import { SelectableCollectionReturnType } from '@/modules/collection/hooks/useSelectableCollection.ts';
|
||||
import {
|
||||
actionToTranslationKey,
|
||||
CHAPTER_ACTION_TO_TRANSLATION,
|
||||
ChapterAction,
|
||||
ChapterBookmarkInfo,
|
||||
ChapterDownloadInfo,
|
||||
@@ -92,7 +92,7 @@ export const ChapterActionMenuItems = ({
|
||||
settings: { deleteChaptersWithBookmark },
|
||||
} = useMetadataServerSettings();
|
||||
|
||||
const getMenuItemTitle = createGetMenuItemTitle(isSingleMode, actionToTranslationKey);
|
||||
const getMenuItemTitle = createGetMenuItemTitle(isSingleMode, CHAPTER_ACTION_TO_TRANSLATION);
|
||||
const shouldShowMenuItem = createShouldShowMenuItem(isSingleMode);
|
||||
const isMenuItemDisabled = createIsMenuItemDisabled(isSingleMode);
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ import { epochToDate, getDateString } from '@/util/DateHelper.ts';
|
||||
|
||||
export type ChapterAction = 'download' | 'delete' | 'bookmark' | 'unbookmark' | 'mark_as_read' | 'mark_as_unread';
|
||||
|
||||
export const actionToTranslationKey: {
|
||||
export const CHAPTER_ACTION_TO_TRANSLATION: {
|
||||
[key in ChapterAction]: {
|
||||
action: {
|
||||
single: TranslationKey;
|
||||
@@ -318,10 +318,10 @@ export class Chapters {
|
||||
): Promise<void> {
|
||||
try {
|
||||
await fnToExecute();
|
||||
makeToast(translate(actionToTranslationKey[action].success, { count: itemCount }), 'success');
|
||||
makeToast(translate(CHAPTER_ACTION_TO_TRANSLATION[action].success, { count: itemCount }), 'success');
|
||||
} catch (e) {
|
||||
makeToast(
|
||||
translate(actionToTranslationKey[action].error, { count: itemCount }),
|
||||
translate(CHAPTER_ACTION_TO_TRANSLATION[action].error, { count: itemCount }),
|
||||
'error',
|
||||
getErrorMessage(e),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user