mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-11 20:00:29 +01:00
Change hotkey handling to capture phase
This commit is contained in:
@@ -91,7 +91,6 @@ export function GrpcEditor({
|
||||
}, [alert, services, request.method, request.service]);
|
||||
|
||||
const reflectionUnavailable = reflectionError?.match(/unimplemented/i);
|
||||
const reflectionSuccess = !reflectionError && services != null && request.protoFiles.length === 0;
|
||||
reflectionError = reflectionUnavailable ? undefined : reflectionError;
|
||||
|
||||
return (
|
||||
@@ -105,7 +104,7 @@ export function GrpcEditor({
|
||||
placeholder="..."
|
||||
ref={editorViewRef}
|
||||
actions={[
|
||||
<div key="reflection" className={classNames(!reflectionSuccess && '!opacity-100')}>
|
||||
<div key="reflection" className={classNames(services == null && '!opacity-100')}>
|
||||
<Button
|
||||
size="xs"
|
||||
color={
|
||||
|
||||
@@ -52,7 +52,7 @@ export function GrpcProtoSelection({ requestId }: Props) {
|
||||
await grpc.reflect.refetch();
|
||||
}}
|
||||
>
|
||||
Add Files
|
||||
Add File
|
||||
</Button>
|
||||
<Button
|
||||
isLoading={grpc.reflect.isFetching}
|
||||
@@ -139,7 +139,7 @@ export function GrpcProtoSelection({ requestId }: Props) {
|
||||
<Link href="https://github.com/grpc/grpc/blob/9aa3c5835a4ed6afae9455b63ed45c761d695bca/doc/server-reflection.md">
|
||||
Server Reflection
|
||||
</Link>{' '}
|
||||
. Please manually add the <InlineCode>.proto</InlineCode> files to get started.
|
||||
. Please manually add the <InlineCode>.proto</InlineCode> file to get started.
|
||||
</Banner>
|
||||
)}
|
||||
</VStack>
|
||||
|
||||
@@ -112,11 +112,11 @@ export function useAnyHotkey(
|
||||
}
|
||||
currentKeys.current.delete(normalizeKey(e.key, os));
|
||||
};
|
||||
document.addEventListener('keydown', down);
|
||||
document.addEventListener('keyup', up);
|
||||
document.addEventListener('keydown', down, { capture: true });
|
||||
document.addEventListener('keyup', up, { capture: true });
|
||||
return () => {
|
||||
document.removeEventListener('keydown', down);
|
||||
document.removeEventListener('keyup', up);
|
||||
document.removeEventListener('keydown', down, { capture: true });
|
||||
document.removeEventListener('keyup', up, { capture: true });
|
||||
};
|
||||
}, [options.enable, os]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user