From 5d587d9479fa86b78b56b2a6c9b65e64e6d57977 Mon Sep 17 00:00:00 2001 From: Jannis Mattheis Date: Sat, 17 Apr 2021 10:12:48 +0200 Subject: [PATCH] Upgrade typescript --- ui/package.json | 2 +- ui/src/Room.tsx | 4 ++-- ui/src/useRoom.ts | 4 ++-- ui/tsconfig.json | 2 +- ui/yarn.lock | 8 ++++---- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ui/package.json b/ui/package.json index 4188fc9..f875f26 100644 --- a/ui/package.json +++ b/ui/package.json @@ -16,7 +16,7 @@ "react-dom": "^17.0.2", "react-hotkeys-hook": "^3.3.0", "react-scripts": "4.0.3", - "typescript": "~3.7.2", + "typescript": "~4.2.4", "unique-names-generator": "^4.4.0", "use-http": "^1.0.19" }, diff --git a/ui/src/Room.tsx b/ui/src/Room.tsx index f140c94..4fcb993 100644 --- a/ui/src/Room.tsx +++ b/ui/src/Room.tsx @@ -66,7 +66,7 @@ export const Room = ({ const [nameInput, setNameInput] = React.useState(''); const [permanent, setPermanent] = React.useState(false); const [showControl, setShowControl] = React.useState(true); - const [hoverControl, setHoverControl] = React.useState(); + const [hoverControl, setHoverControl] = React.useState(false); const [showMore, setShowMore] = React.useState(); const [selectedStream, setSelectedStream] = React.useState(); const [videoElement, setVideoElement] = React.useState(null); @@ -251,7 +251,7 @@ export const Room = ({ anchorEl={showMore} keepMounted open={Boolean(showMore)} - onClose={(e) => setShowMore(undefined)}> + onClose={() => setShowMore(undefined)}> { setShowMore(undefined); diff --git a/ui/src/useRoom.ts b/ui/src/useRoom.ts index f2046e9..0b16035 100644 --- a/ui/src/useRoom.ts +++ b/ui/src/useRoom.ts @@ -119,7 +119,7 @@ const clientSession = async ({ return peer; }; -export type FCreateRoom = (room: RoomCreate | JoinRoom) => Promise; +export type FCreateRoom = (room: RoomCreate | JoinRoom) => Promise; export const useRoom = (): UseRoom => { const [roomID, setRoomID] = useRoomID(); @@ -133,7 +133,7 @@ export const useRoom = (): UseRoom => { const room: FCreateRoom = React.useCallback( (create) => { - return new Promise((resolve) => { + return new Promise((resolve) => { const ws = (conn.current = new WebSocket( urlWithSlash.replace('http', 'ws') + 'stream' )); diff --git a/ui/tsconfig.json b/ui/tsconfig.json index fbce9be..e18c413 100644 --- a/ui/tsconfig.json +++ b/ui/tsconfig.json @@ -17,7 +17,7 @@ "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, - "jsx": "react", + "jsx": "react-jsx", "noFallthroughCasesInSwitch": true }, "include": [ diff --git a/ui/yarn.lock b/ui/yarn.lock index 690af57..80bbd47 100644 --- a/ui/yarn.lock +++ b/ui/yarn.lock @@ -11664,10 +11664,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@~3.7.2: - version "3.7.5" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.5.tgz#0692e21f65fd4108b9330238aac11dd2e177a1ae" - integrity sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw== +typescript@~4.2.4: + version "4.2.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.2.4.tgz#8610b59747de028fda898a8aef0e103f156d0961" + integrity sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg== unbox-primitive@^1.0.0: version "1.0.1"