Skip to content

Commit

Permalink
Reduce the number of warnings/errors
Browse files Browse the repository at this point in the history
These are all small fixes that came from replayio#4346 that either eliminate
possible console errors or eliminate linting/tsc errors.
  • Loading branch information
jcmorrow committed Nov 9, 2021
1 parent bb4395d commit 3c352dc
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import "../src/test-prep";
import "ui/utils/whatwg-url-fix";

import Head from "next/head";
import Script from "next/script";
import type { AppProps } from "next/app";
import React, { useEffect, useState } from "react";
import { Provider } from "react-redux";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function BreakpointNavigationStatus({ executionPoint, analysisPoints, indexed })
let maxStatusLength = 0;
if (!indexed) {
status = "Indexing";
} else if (!analysisPoints | !executionPoint) {
} else if (!analysisPoints || !executionPoint) {
status = "Loading";
} else if (analysisPoints === "error") {
status = "Failed";
Expand Down
2 changes: 1 addition & 1 deletion src/protocol/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const DisallowEverythingProxyHandler: ProxyHandler<object> = {
// return false;
//},
get() {
NotAllowed();
return undefined;
},
//set() { NotAllowed(); },
apply() {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/hooks/recordings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export function useIsTeamDeveloper() {
console.error("Apollo error while getting the user's role", error);
}

return { isTeamDeveloper: data.recording.userRole !== "team-user", loading };
return { isTeamDeveloper: data?.recording.userRole !== "team-user", loading };
}

function convertRecording(rec: any): Recording | undefined {
Expand Down
3 changes: 1 addition & 2 deletions src/ui/utils/tokenManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { AppState } from "@auth0/auth0-react/dist/auth0-provider";
import jwt_decode from "jwt-decode";
import React, { ReactNode } from "react";
import { assert, defer, Deferred } from "protocol/utils";
import { isTest } from "./environment";
import { usesWindow } from "ssr";
import { useRouter } from "next/dist/client/router";

Expand Down Expand Up @@ -159,7 +158,7 @@ class TokenManager {

try {
return await this.auth0Client.getAccessTokenSilently({ audience, ignoreCache: refresh });
} catch (e) {
} catch (e: any) {
if (e.error !== "login_required" && e.error !== "consent_required") {
throw e;
}
Expand Down

0 comments on commit 3c352dc

Please sign in to comment.