Get rid of some casts
This commit is contained in:
@@ -194,7 +194,7 @@ export class Chapters {
|
||||
|
||||
return [chapterA, matchingChapter];
|
||||
})
|
||||
.filter((matchingChapters) => matchingChapters !== null) as [Chapter, Chapter][];
|
||||
.filter((matchingChapters): matchingChapters is [Chapter, Chapter] => matchingChapters !== null);
|
||||
}
|
||||
|
||||
static async download(chapterIds: number[]): Promise<void> {
|
||||
|
||||
@@ -94,7 +94,7 @@ function getExtensionsInfo(extensions: TExtension[]): {
|
||||
|
||||
return {
|
||||
allLangs,
|
||||
groupedExtensions: (result as GroupedExtensionsResult).concat(langExt),
|
||||
groupedExtensions: result.concat(langExt),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -174,7 +174,7 @@ const useSourceManga = (
|
||||
let allItems: FetchItemsResult = [];
|
||||
|
||||
pages.forEach((page, index) => {
|
||||
const pageItems = page.data?.fetchSourceManga?.mangas ?? ([] as FetchItemsResult);
|
||||
const pageItems = page.data?.fetchSourceManga?.mangas ?? [];
|
||||
const nonLibraryPageItems = pageItems.filter((item) => !hideLibraryEntries || !item.inLibrary);
|
||||
const uniqueItems = getUniqueMangas([...allItems, ...nonLibraryPageItems]);
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ export const BrowseSettings = () => {
|
||||
updateSetting('extensionRepos', repos);
|
||||
requestManager.clearExtensionCache();
|
||||
}}
|
||||
valueInfos={serverSettings.extensionRepos.map((extensionRepo) => [extensionRepo]) as [string][]}
|
||||
valueInfos={serverSettings.extensionRepos.map((extensionRepo) => [extensionRepo])}
|
||||
addItemButtonTitle={t('extension.settings.repositories.custom.dialog.action.button.add')}
|
||||
placeholder="https://github.com/MY_ACCOUNT/MY_REPO/tree/repo"
|
||||
validateItem={(repo) =>
|
||||
|
||||
@@ -165,7 +165,7 @@ export function Categories() {
|
||||
<Draggable key={item.id} draggableId={item.id.toString()} index={index}>
|
||||
{(draggableProvided, snapshot) => (
|
||||
<ListItem
|
||||
ContainerProps={{ ref: draggableProvided.innerRef } as any}
|
||||
ref={draggableProvided.innerRef}
|
||||
{...draggableProvided.draggableProps}
|
||||
{...draggableProvided.dragHandleProps}
|
||||
style={getItemStyle(
|
||||
@@ -173,7 +173,6 @@ export function Categories() {
|
||||
draggableProvided.draggableProps.style,
|
||||
theme.palette,
|
||||
)}
|
||||
ref={draggableProvided.innerRef}
|
||||
>
|
||||
<ListItemIcon>
|
||||
<DragHandleIcon />
|
||||
|
||||
Reference in New Issue
Block a user