Update dependencies (#3123)

* Update localforage, remove query-string
* Update fontawesome and flag-icons
* Update formatjs
* Update axios and videojs
* Update apollo client and graphql
* Update bootstrap and react
* Update polyfills
* Update vite
* Update ESLint
* Update stylelint
* Update configs
* Rebuild yarn.lock
This commit is contained in:
DingDongSoLong4
2023-02-16 05:06:44 +02:00
committed by GitHub
parent 0c9eeef143
commit a1851b3713
137 changed files with 5102 additions and 5729 deletions

View File

@@ -12,7 +12,6 @@ import {
} from "react-bootstrap";
import { Link, useHistory } from "react-router-dom";
import { FormattedMessage, FormattedNumber, useIntl } from "react-intl";
import querystring from "query-string";
import * as GQL from "src/core/generated-graphql";
import {
@@ -47,20 +46,13 @@ const CLASSNAME = "duplicate-checker";
export const SceneDuplicateChecker: React.FC = () => {
const intl = useIntl();
const history = useHistory();
const { page, size, distance } = querystring.parse(history.location.search);
const currentPage = Number.parseInt(
Array.isArray(page) ? page[0] : page ?? "1",
10
);
const pageSize = Number.parseInt(
Array.isArray(size) ? size[0] : size ?? "20",
10
);
const query = new URLSearchParams(history.location.search);
const currentPage = Number.parseInt(query.get("page") ?? "1", 10);
const pageSize = Number.parseInt(query.get("size") ?? "20", 10);
const hashDistance = Number.parseInt(query.get("distance") ?? "0", 10);
const [currentPageSize, setCurrentPageSize] = useState(pageSize);
const hashDistance = Number.parseInt(
Array.isArray(distance) ? distance[0] : distance ?? "0",
10
);
const [isMultiDelete, setIsMultiDelete] = useState(false);
const [deletingScenes, setDeletingScenes] = useState(false);
const [editingScenes, setEditingScenes] = useState(false);
@@ -90,9 +82,8 @@ export const SceneDuplicateChecker: React.FC = () => {
GQL.SlimSceneDataFragment[] | null
>(null);
const [mergeScenes, setMergeScenes] = useState<
{ id: string; title: string }[] | undefined
>(undefined);
const [mergeScenes, setMergeScenes] =
useState<{ id: string; title: string }[]>();
if (loading) return <LoadingIndicator />;
if (!data) return <ErrorMessage error="Error searching for duplicates." />;
@@ -107,12 +98,16 @@ export const SceneDuplicateChecker: React.FC = () => {
).length;
const setQuery = (q: Record<string, string | number | undefined>) => {
history.push({
search: querystring.stringify({
...querystring.parse(history.location.search),
...q,
}),
});
const newQuery = new URLSearchParams(query);
for (const key of Object.keys(q)) {
const value = q[key];
if (value !== undefined) {
newQuery.set(key, String(value));
} else {
newQuery.delete(key);
}
}
history.push({ search: newQuery.toString() });
};
function onDeleteDialogClosed(deleted: boolean) {
@@ -504,7 +499,7 @@ export const SceneDuplicateChecker: React.FC = () => {
page: undefined,
})
}
defaultValue={distance ?? 0}
defaultValue={hashDistance}
className="input-control ml-4"
>
<option value={0}>