Skip to content

armgit / ente

Public Imported from GitHub
0

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

fix(web): resolve memories lint setup and eslint issues

AmanRajSinghMourya648775bb7284
diff --git a/web/apps/memories/eslint.config.mjs b/web/apps/memories/eslint.config.mjs
new file mode 100644
index 0000000000..641d994d1e
--- /dev/null
+++ b/web/apps/memories/eslint.config.mjs
@@ -0,0 +1 @@
+export { default } from "ente-build-config/eslintrc-next-app.mjs";
diff --git a/web/apps/memories/src/pages/index.tsx b/web/apps/memories/src/pages/index.tsx
index 2295bf5792..b0bdbd611c 100644
--- a/web/apps/memories/src/pages/index.tsx
+++ b/web/apps/memories/src/pages/index.tsx
@@ -34,9 +34,7 @@ const extractMemoryShareKeyFromURL = async (
if (!fragment) return null;
if (shortMemorySecretPattern.test(fragment)) {
- const subtle = globalThis.crypto?.subtle;
- if (!subtle) return null;
- const digest = await subtle.digest(
+ const digest = await globalThis.crypto.subtle.digest(
"SHA-256",
new TextEncoder().encode(fragment),
);
@@ -79,7 +77,10 @@ export default function PublicMemoryPage() {
// non-empty path segment as token.
const tokenFromPath = currentURL.pathname
.split("/")
- .find((segment) => segment.length > 0 && segment !== "memory");
+ .find(
+ (segment) =>
+ segment.length > 0 && segment !== "memory",
+ );
if (tokenFromPath) {
token = tokenFromPath;
}
@@ -140,7 +141,7 @@ export default function PublicMemoryPage() {
setLoading(false);
}
};
- main();
+ void main();
return () => downloadManager.setPublicMemoryCredentials(undefined);
}, []);
@@ -338,7 +339,9 @@ const MemoryViewer: React.FC<MemoryViewerProps> = ({
const previousFile = previousFileRef.current;
if (previousIndex !== currentIndex) {
setOutgoingFile(previousFile);
- setOutgoingIsVideo(previousFile.metadata.fileType === FileType.video);
+ setOutgoingIsVideo(
+ previousFile.metadata.fileType === FileType.video,
+ );
setOutgoingIndex(previousIndex);
if (outgoingClearTimeoutRef.current !== null) {
@@ -628,7 +631,10 @@ const MemoryViewer: React.FC<MemoryViewerProps> = ({
}
>
<MediaFrame style={mediaFrameStyle}>
- <MediaSwitchLayer phase="in" key={`memory-file-${currentIndex}`}>
+ <MediaSwitchLayer
+ phase="in"
+ key={`memory-file-${currentIndex}`}
+ >
{isVideo ? (
<VideoPlayer
file={currentFile}
@@ -949,11 +955,17 @@ const ProgressIndicator: React.FC<ProgressIndicatorProps> = ({
: `segment-${i}`
}
state={
- i < current ? "past" : i === current ? "active" : "future"
+ i < current
+ ? "past"
+ : i === current
+ ? "active"
+ : "future"
}
paused={paused}
duration={duration}
- onComplete={i === current && !isVideo ? onComplete : undefined}
+ onComplete={
+ i === current && !isVideo ? onComplete : undefined
+ }
/>
))}
</Box>
@@ -1259,7 +1271,7 @@ const VideoPlayer: React.FC<VideoPlayerProps> = ({
if (
!cancelled &&
typeof hlsPlaylistData === "object" &&
- hlsPlaylistData?.playlistURL
+ hlsPlaylistData.playlistURL
) {
setHlsData(hlsPlaylistData);
return;
@@ -1280,7 +1292,7 @@ const VideoPlayer: React.FC<VideoPlayerProps> = ({
}
}
};
- load();
+ void load();
return () => {
cancelled = true;
};
diff --git a/web/package.json b/web/package.json
index 784f5302da..d763839151 100644
--- a/web/package.json
+++ b/web/package.json
@@ -13,6 +13,7 @@
"build:cast": "yarn build:wasm && yarn workspace cast next build",
"build:embed": "yarn build:wasm && yarn workspace embed next build",
"build:ensu": "yarn build:wasm && yarn workspace ensu next build",
+ "build:memories": "yarn build:wasm && yarn workspace memories next build && yarn workspace memories build:post",
"build:paste": "yarn build:wasm && yarn workspace paste next build && yarn workspace paste build:post",
"build:payments": "yarn workspace payments build",
"build:photos": "yarn build:wasm && yarn workspace photos next build",
@@ -25,12 +26,11 @@
"dev:cast": "yarn build:wasm && yarn workspace cast next dev -p 3004",
"dev:embed": "yarn build:wasm && yarn workspace embed next dev -p 3006",
"dev:ensu": "yarn build:wasm && yarn workspace ensu next dev -p 3007",
+ "dev:memories": "yarn build:wasm && yarn workspace memories next dev -p 3007",
"dev:paste": "yarn build:wasm && yarn workspace paste next dev -p 3008",
"dev:payments": "yarn workspace payments dev",
"dev:photos": "yarn build:wasm && yarn workspace photos next dev -p 3000",
"dev:share": "yarn build:wasm && yarn workspace share next dev -p 3005",
- "dev:memories": "yarn build:wasm && yarn workspace memories next dev -p 3007",
- "build:memories": "yarn build:wasm && yarn workspace memories next build && yarn workspace memories build:post",
"lint": "concurrently --names 'prettier,eslint,tsc' \"yarn prettier --check --log-level warn .\" \"yarn workspaces run eslint\" \"yarn workspaces run tsc\"",
"lint-fix": "concurrently --names 'prettier,eslint,tsc' \"yarn prettier --write --log-level warn .\" \"yarn workspaces run eslint --fix\" \"yarn workspaces run tsc\"",
"test": "yarn workspace ente-wasm test",