Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

condition for instanceof HTMLInputElement

mngshm7d1670d2101c
diff --git a/infra/staff/src/App.tsx b/infra/staff/src/App.tsx
index 8eb972bb52..8fc95d6c19 100644
--- a/infra/staff/src/App.tsx
+++ b/infra/staff/src/App.tsx
@@ -243,16 +243,20 @@ const App: React.FC = () => {
setLocalToken(userToken);
setToken(userToken);
- document.getElementById(":r1:").readOnly = true;
+ const editToken = document.getElementById(":r1:");
+ if (editToken instanceof HTMLInputElement) {
+ editToken.readOnly = true;
+ }
}
}, []);
const updateToken = () => {
const editToken = document.getElementById(":r1:");
- editToken.readOnly = false;
-
- // Change focus to Token input form
- editToken.focus();
+ if (editToken instanceof HTMLInputElement) {
+ editToken.readOnly = false;
+ // Change focus to token field
+ editToken.focus();
+ }
};
return (
@@ -287,7 +291,6 @@ const App: React.FC = () => {
style={{ maxWidth: "parent" }}
/>
<Link
- to="/"
style={{ textAlign: "left" }}
onClick={updateToken}
>
diff --git a/web/apps/photos/src/components/Sidebar/index.tsx b/web/apps/photos/src/components/Sidebar/index.tsx
index bcc2a9051d..44f4c985e2 100644
--- a/web/apps/photos/src/components/Sidebar/index.tsx
+++ b/web/apps/photos/src/components/Sidebar/index.tsx
@@ -47,6 +47,7 @@ import {
} from "@ente/shared/components/Container";
import { EnteMenuItem } from "@ente/shared/components/Menu/EnteMenuItem";
import { PHOTOS_PAGES as PAGES } from "@ente/shared/constants/pages";
+import { getToken } from "@ente/shared/storage/localStorage/helpers";
import { THEME_COLOR } from "@ente/shared/themes/constants";
import ArchiveOutlinedIcon from "@mui/icons-material/ArchiveOutlined";
import CategoryIcon from "@mui/icons-material/Category";
@@ -89,7 +90,6 @@ import exportService from "services/export";
import { testUpload } from "../../../tests/upload.test";
import { Preferences } from "./Preferences";
import { SubscriptionCard } from "./SubscriptionCard";
-import { getToken } from "@ente/shared/storage/localStorage/helpers";
interface Iprops {
collectionSummaries: CollectionSummaries;