Skip to content

Commit

Permalink
Move "RequestManager" in sub folder
Browse files Browse the repository at this point in the history
  • Loading branch information
schroda committed Oct 27, 2023
1 parent 1c794c2 commit bffc166
Show file tree
Hide file tree
Showing 29 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/components/ExtensionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Typography from '@mui/material/Typography';
import { Box } from '@mui/material';
import { useTranslation } from 'react-i18next';
import { IExtension, TranslationKey } from '@/typings';
import requestManager from '@/lib/RequestManager';
import requestManager from '@/lib/requests/RequestManager.ts';

interface IProps {
extension: IExtension;
Expand Down
2 changes: 1 addition & 1 deletion src/components/MangaCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Link } from 'react-router-dom';
import { Avatar, Box, CardContent, styled } from '@mui/material';
import { useTranslation } from 'react-i18next';
import { IMangaCard } from '@/typings';
import requestManager from '@/lib/RequestManager';
import requestManager from '@/lib/requests/RequestManager.ts';
import { GridLayout, useLibraryOptionsContext } from '@/components/context/LibraryOptionsContext';
import SpinnerImage from '@/components/util/SpinnerImage';

Expand Down
2 changes: 1 addition & 1 deletion src/components/SourceCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import React from 'react';
import { useTranslation } from 'react-i18next';
import { Link } from 'react-router-dom';
import { ISource } from '@/typings';
import requestManager from '@/lib/RequestManager';
import requestManager from '@/lib/requests/RequestManager.ts';
import { translateExtensionLanguage } from '@/screens/util/Extensions';
import { SourceContentType } from '@/screens/SourceMangas';

Expand Down
2 changes: 1 addition & 1 deletion src/components/library/UpdateChecker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { Box } from '@mui/material';
import Typography from '@mui/material/Typography';
import { useTranslation } from 'react-i18next';
import { IUpdateStatus } from '@/typings';
import requestManager from '@/lib/RequestManager';
import requestManager from '@/lib/requests/RequestManager.ts';
import makeToast from '@/components/util/Toast';

interface IProgressProps {
Expand Down
2 changes: 1 addition & 1 deletion src/components/library/useSubscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import { useEffect, useState } from 'react';
import requestManager from '@/lib/RequestManager';
import requestManager from '@/lib/requests/RequestManager.ts';

const useSubscription = <T>(path: string, callback?: (newValue: T) => boolean | void) => {
const [state, setState] = useState<T | undefined>();
Expand Down
2 changes: 1 addition & 1 deletion src/components/manga/ChapterCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import React from 'react';
import { Link } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
import { IChapter, IDownloadChapter } from '@/typings';
import requestManager from '@/lib/RequestManager';
import requestManager from '@/lib/requests/RequestManager.ts';
import { getUploadDateString } from '@/util/date';
import DownloadStateIndicator from '@/components/molecules/DownloadStateIndicator';

Expand Down
2 changes: 1 addition & 1 deletion src/components/manga/ChapterList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import React, { ComponentProps, useEffect, useMemo, useRef, useState } from 'rea
import { Virtuoso } from 'react-virtuoso';
import { useTranslation } from 'react-i18next';
import { BatchChaptersChange, IChapter, IDownloadChapter, IQueue, TranslationKey } from '@/typings';
import requestManager from '@/lib/RequestManager';
import requestManager from '@/lib/requests/RequestManager.ts';
import useSubscription from '@/components/library/useSubscription';
import ChapterCard from '@/components/manga/ChapterCard';
import ResumeFab from '@/components/manga/ResumeFAB';
Expand Down
2 changes: 1 addition & 1 deletion src/components/manga/MangaDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { mutate } from 'swr';
import { t as translate } from 'i18next';
import Button from '@mui/material/Button';
import { IManga, ISource } from '@/typings';
import requestManager from '@/lib/RequestManager';
import requestManager from '@/lib/requests/RequestManager.ts';
import makeToast from '@/components/util/Toast';

const DetailsWrapper = styled('div')(({ theme }) => ({
Expand Down
2 changes: 1 addition & 1 deletion src/components/manga/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import { useCallback, useEffect, useState } from 'react';
import { mutate } from 'swr';
import requestManager, { RequestManager } from '@/lib/RequestManager';
import requestManager, { RequestManager } from '@/lib/requests/RequestManager.ts';

export const useRefreshManga = (mangaId: string) => {
const [fetchingOnline, setFetchingOnline] = useState(false);
Expand Down
2 changes: 1 addition & 1 deletion src/components/navbar/action/CategorySelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import Checkbox from '@mui/material/Checkbox';
import FormControlLabel from '@mui/material/FormControlLabel';
import FormGroup from '@mui/material/FormGroup';
import { useTranslation } from 'react-i18next';
import requestManager from '@/lib/RequestManager';
import requestManager from '@/lib/requests/RequestManager.ts';

interface IProps {
open: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import {
SourcePreferences,
SourceSearchResult,
UpdateCheck,
} from '@/typings';
import { HttpMethod as DefaultHttpMethod, IRestClient, RestClient } from '@/lib/RestClient';
import storage from '@/util/localStorage';
} from '@/typings.ts';
import { HttpMethod as DefaultHttpMethod, IRestClient, RestClient } from '@/lib/RestClient.ts';
import storage from '@/util/localStorage.tsx';

enum SWRHttpMethod {
SWR_GET,
Expand Down
2 changes: 1 addition & 1 deletion src/screens/DownloadQueue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import Typography from '@mui/material/Typography';
import { Link } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
import { IChapter, IQueue } from '@/typings';
import requestManager from '@/lib/RequestManager';
import requestManager from '@/lib/requests/RequestManager.ts';
import StrictModeDroppable from '@/lib/StrictModeDroppable';
import makeToast from '@/components/util/Toast';
import { NavbarToolbar } from '@/components/navbar/DefaultNavBar';
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Extensions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { Virtuoso } from 'react-virtuoso';
import { Typography, useMediaQuery, useTheme } from '@mui/material';
import { useTranslation } from 'react-i18next';
import { IExtension } from '@/typings';
import requestManager from '@/lib/RequestManager';
import requestManager from '@/lib/requests/RequestManager.ts';
import { extensionDefaultLangs, DefaultLanguage, langSortCmp } from '@/util/language';
import useLocalStorage from '@/util/useLocalStorage';
import {
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Library.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Chip, Tab, Tabs, styled, Box } from '@mui/material';
import React, { useContext, useEffect, useMemo, useState } from 'react';
import { useQueryParam, NumberParam } from 'use-query-params';
import { useTranslation } from 'react-i18next';
import requestManager from '@/lib/RequestManager';
import requestManager from '@/lib/requests/RequestManager.ts';
import NavbarContext from '@/components/context/NavbarContext';
import EmptyView from '@/components/util/EmptyView';
import LoadingPlaceholder from '@/components/util/LoadingPlaceholder';
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Manga.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { CircularProgress, IconButton, Stack, Tooltip, Box } from '@mui/material
import React, { useContext, useEffect, useRef } from 'react';
import { useTranslation } from 'react-i18next';
import { useParams } from 'react-router-dom';
import requestManager from '@/lib/RequestManager';
import requestManager from '@/lib/requests/RequestManager.ts';
import NavbarContext, { useSetDefaultBackTo } from '@/components/context/NavbarContext';
import ChapterList from '@/components/manga/ChapterList';
import { useRefreshManga } from '@/components/manga/hooks';
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Reader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { useLocation, useNavigate, useParams } from 'react-router-dom';
import { Box } from '@mui/material';
import { useTranslation } from 'react-i18next';
import { ChapterOffset, IChapter, IManga, IMangaCard, IReaderSettings, ReaderType, TranslationKey } from '@/typings';
import requestManager from '@/lib/RequestManager';
import requestManager from '@/lib/requests/RequestManager.ts';
import {
checkAndHandleMissingStoredReaderSettings,
getReaderSettingsFor,
Expand Down
2 changes: 1 addition & 1 deletion src/screens/SearchAll.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { Link } from 'react-router-dom';
import { StringParam, useQueryParam } from 'use-query-params';
import { useTranslation } from 'react-i18next';
import { ISource } from '@/typings';
import requestManager from '@/lib/RequestManager';
import requestManager from '@/lib/requests/RequestManager.ts';
import useLocalStorage from '@/util/useLocalStorage';
import { langSortCmp, sourceDefualtLangs, sourceForcedDefaultLangs } from '@/util/language';
import { translateExtensionLanguage } from '@/screens/util/Extensions';
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import ViewModuleIcon from '@mui/icons-material/ViewModule';
import { useTranslation } from 'react-i18next';
import LanguageIcon from '@mui/icons-material/Language';
import CollectionsOutlinedBookmarkIcon from '@mui/icons-material/CollectionsBookmarkOutlined';
import requestManager from '@/lib/RequestManager';
import requestManager from '@/lib/requests/RequestManager.ts';
import { langCodeToName } from '@/util/language';
import useLocalStorage from '@/util/useLocalStorage';
import ListItemLink from '@/components/util/ListItemLink';
Expand Down
2 changes: 1 addition & 1 deletion src/screens/SourceConfigure.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { createElement, useContext, useEffect } from 'react';
import { useParams } from 'react-router-dom';
import List from '@mui/material/List';
import { useTranslation } from 'react-i18next';
import requestManager from '@/lib/RequestManager';
import requestManager from '@/lib/requests/RequestManager.ts';
import cloneObject from '@/util/cloneObject';
import NavbarContext from '@/components/context/NavbarContext';
import { SwitchPreferenceCompat, CheckBoxPreference } from '@/components/sourceConfiguration/TwoStatePreference';
Expand Down
2 changes: 1 addition & 1 deletion src/screens/SourceMangas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import FavoriteIcon from '@mui/icons-material/Favorite';
import NewReleasesIcon from '@mui/icons-material/NewReleases';
import FilterListIcon from '@mui/icons-material/FilterList';
import { IManga, PaginatedMangaList, TranslationKey } from '@/typings';
import requestManager, { AbortableSWRInfiniteResponse } from '@/lib/RequestManager';
import requestManager, { AbortableSWRInfiniteResponse } from '@/lib/requests/RequestManager.ts';
import { useDebounce } from '@/components/manga/hooks';
import { useLibraryOptionsContext } from '@/components/context/LibraryOptionsContext';
import SourceGridLayout from '@/components/source/GridLayouts';
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Sources.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import TravelExploreIcon from '@mui/icons-material/TravelExplore';
import { useNavigate } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
import { ISource } from '@/typings';
import requestManager from '@/lib/RequestManager';
import requestManager from '@/lib/requests/RequestManager.ts';
import useLocalStorage from '@/util/useLocalStorage';
import { sourceDefualtLangs, sourceForcedDefaultLangs, langSortCmp } from '@/util/language';
import { translateExtensionLanguage } from '@/screens/util/Extensions';
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Updates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { useTranslation } from 'react-i18next';
import { t as translate } from 'i18next';
import { GroupedVirtuoso } from 'react-virtuoso';
import { IChapter, IMangaChapter, IQueue } from '@/typings';
import requestManager from '@/lib/RequestManager';
import requestManager from '@/lib/requests/RequestManager.ts';
import LoadingPlaceholder from '@/components/util/LoadingPlaceholder';
import EmptyView from '@/components/util/EmptyView';
import DownloadStateIndicator from '@/components/molecules/DownloadStateIndicator';
Expand Down
2 changes: 1 addition & 1 deletion src/screens/settings/About.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import List from '@mui/material/List';
import ListItem from '@mui/material/ListItem';
import ListItemText from '@mui/material/ListItemText';
import { useTranslation } from 'react-i18next';
import requestManager from '@/lib/RequestManager';
import requestManager from '@/lib/requests/RequestManager.ts';
import ListItemLink from '@/components/util/ListItemLink';
import NavbarContext, { useSetDefaultBackTo } from '@/components/context/NavbarContext';
import LoadingPlaceholder from '@/components/util/LoadingPlaceholder';
Expand Down
2 changes: 1 addition & 1 deletion src/screens/settings/Backup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import ListItemText from '@mui/material/ListItemText';
import { fromEvent } from 'file-selector';
import { useTranslation } from 'react-i18next';
import { ListItemButton } from '@mui/material';
import requestManager from '@/lib/RequestManager';
import requestManager from '@/lib/requests/RequestManager.ts';
import makeToast from '@/components/util/Toast';
import ListItemLink from '@/components/util/ListItemLink';
import NavbarContext, { useSetDefaultBackTo } from '@/components/context/NavbarContext';
Expand Down
2 changes: 1 addition & 1 deletion src/screens/settings/Categories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import Checkbox from '@mui/material/Checkbox';
import FormControlLabel from '@mui/material/FormControlLabel';
import { useTranslation } from 'react-i18next';
import { ICategory } from '@/typings';
import requestManager from '@/lib/RequestManager';
import requestManager from '@/lib/requests/RequestManager.ts';
import StrictModeDroppable from '@/lib/StrictModeDroppable';
import { DEFAULT_FULL_FAB_HEIGHT } from '@/components/util/StyledFab';
import NavbarContext, { useSetDefaultBackTo } from '@/components/context/NavbarContext';
Expand Down
2 changes: 1 addition & 1 deletion src/screens/settings/LibrarySettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { styled } from '@mui/material';
import { t as translate } from 'i18next';
import { useTranslation } from 'react-i18next';
import { ICategory, IncludeInGlobalUpdate } from '@/typings';
import requestManager from '@/lib/RequestManager';
import requestManager from '@/lib/requests/RequestManager.ts';
import makeToast from '@/components/util/Toast';
import ThreeStateCheckboxInput from '@/components/atoms/ThreeStateCheckboxInput';
import NavbarContext, { useSetDefaultBackTo } from '@/components/context/NavbarContext';
Expand Down
2 changes: 1 addition & 1 deletion src/util/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
MetadataHolder,
MetadataKeyValuePair,
} from '@/typings';
import requestManager, { RequestManager } from '@/lib/RequestManager';
import requestManager, { RequestManager } from '@/lib/requests/RequestManager.ts';

const APP_METADATA_KEY_PREFIX = 'webUI_';

Expand Down
2 changes: 1 addition & 1 deletion src/util/readerSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import { IManga, Metadata, MetadataHolder, IReaderSettings, MetadataKeyValuePair } from '@/typings';
import requestManager from '@/lib/RequestManager';
import requestManager from '@/lib/requests/RequestManager.ts';
import { getMetadataFrom, requestUpdateMangaMetadata, requestUpdateServerMetadata } from '@/util/metadata';

type UndefinedReaderSettings = {
Expand Down
2 changes: 1 addition & 1 deletion src/util/searchSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import { Metadata, ISearchSettings } from '@/typings';
import requestManager from '@/lib/RequestManager';
import requestManager from '@/lib/requests/RequestManager.ts';
import { getMetadataFrom } from '@/util/metadata';

export const getDefaultSettings = (): ISearchSettings => ({
Expand Down

0 comments on commit bffc166

Please sign in to comment.