Skip to content

armgit / ente

Public Imported from GitHub
0

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

tt

Manav Rathid308d334f8c9
diff --git a/desktop/src/main.ts b/desktop/src/main.ts
index 4cd25881f0..b0c51fb937 100644
--- a/desktop/src/main.ts
+++ b/desktop/src/main.ts
@@ -146,7 +146,7 @@ const registerPrivilegedSchemes = () => {
*
* This window will show the HTML served from {@link rendererURL}.
*/
-const createMainWindow = async () => {
+const createMainWindow = () => {
// Create the main window. This'll show our web content.
const window = new BrowserWindow({
webPreferences: {
@@ -160,7 +160,7 @@ const createMainWindow = async () => {
show: false,
});
- const wasAutoLaunched = await autoLauncher.wasAutoLaunched();
+ const wasAutoLaunched = autoLauncher.wasAutoLaunched();
if (wasAutoLaunched) {
// Don't automatically show the app's window if we were auto-launched.
// On macOS, also hide the dock icon on macOS.
@@ -367,7 +367,7 @@ const main = () => {
// Note that some Electron APIs can only be used after this event occurs.
app.on("ready", async () => {
// Create window and prepare for the renderer.
- mainWindow = await createMainWindow();
+ mainWindow = createMainWindow();
attachIPCHandlers();
attachFSWatchIPCHandlers(createWatcher(mainWindow));
registerStreamProtocol();
diff --git a/desktop/src/main/services/auto-launcher.ts b/desktop/src/main/services/auto-launcher.ts
index c704f73999..4e97a02257 100644
--- a/desktop/src/main/services/auto-launcher.ts
+++ b/desktop/src/main/services/auto-launcher.ts
@@ -38,7 +38,7 @@ class AutoLauncher {
}
}
- async wasAutoLaunched() {
+ wasAutoLaunched() {
if (this.autoLaunch) {
return app.commandLine.hasSwitch("hidden");
} else {
diff --git a/desktop/src/main/services/ml-clip.ts b/desktop/src/main/services/ml-clip.ts
index 451cdcb09b..ddbfb0881d 100644
--- a/desktop/src/main/services/ml-clip.ts
+++ b/desktop/src/main/services/ml-clip.ts
@@ -49,7 +49,7 @@ const clipImageEmbedding_ = async (jpegFilePath: string) => {
return normalizeEmbedding(imageEmbedding);
};
-const getRGBData = async (jpegFilePath: string) => {
+const getRGBData = async (jpegFilePath: string): Promise<number[]> => {
const jpegData = await fs.readFile(jpegFilePath);
const rawImageData = jpeg.decode(jpegData, {
useTArray: true,
@@ -64,7 +64,7 @@ const getRGBData = async (jpegFilePath: string) => {
const ny2 = 224;
const totalSize = 3 * nx2 * ny2;
- const result: number[] = Array(totalSize).fill(0);
+ const result = Array(totalSize).fill(0);
const scale = Math.max(nx, ny) / 224;
const nx3 = Math.round(nx / scale);
diff --git a/desktop/src/main/services/ml-face.ts b/desktop/src/main/services/ml-face.ts
index e4e43a4b0e..e72f043e06 100644
--- a/desktop/src/main/services/ml-face.ts
+++ b/desktop/src/main/services/ml-face.ts
@@ -47,5 +47,7 @@ export const faceEmbedding = async (input: Float32Array) => {
const results = await session.run(feeds);
log.debug(() => `onnx/yolo face embedding took ${Date.now() - t} ms`);
/* Need these model specific casts to extract and type the result */
- return (results.embeddings as unknown as any)["cpuData"] as Float32Array;
+ return (results.embeddings as unknown as Record<string, unknown>)[
+ "cpuData"
+ ] as Float32Array;
};