Compare commits

..
2 Commits
2 changed files with 21 additions and 8 deletions

No files matched your search

+17 -7
View File
@@ -24,7 +24,7 @@ import {
useState,
} from "react";
import { TranslationKey } from "../i18n/i18n";
import { useKey } from "react-use";
import { useKey as _useKey } from "react-use";
import { Handler } from "react-use/lib/useKey";
import { useRouter } from "next/router";
@@ -63,6 +63,21 @@ const KeyboardBindings = createContext<BindingsState & KeyboardBindingsActions>(
},
);
const useKey = (...p: Parameters<typeof _useKey>) => {
return _useKey(
p[0],
(e) => {
const tagName = document.activeElement?.tagName.toLowerCase();
if (tagName == "input" || tagName == "textarea") {
return;
}
p[1]?.(e);
},
p[2],
p[3],
);
};
export const KeyboardBindingsProvider = (props: {
children: JSX.Element[];
}) => {
@@ -130,12 +145,7 @@ export const useKeyboardBinding = (
useKey(
bindingKeyToUseKeyParam(binding.key),
(e) => {
if (document.activeElement?.tagName.toLowerCase() == "input") {
return;
}
binding.handler(e);
},
(e) => binding.handler(e),
{},
[...deps],
);
+4 -1
View File
@@ -191,6 +191,7 @@ export default class TrackService {
queryParameters = deepmerge<Prisma.TrackWhereInput>(
queryParameters,
{
type: "Audio",
song: {
group: {
versions: {
@@ -202,7 +203,9 @@ export default class TrackService {
OR: [
{
album: {
type: "Single",
type: {
not: "StudioRecording",
},
},
},
ReleaseService.formatWhereInput(