diff --git a/src/apps/drive/dependency-injection/offline-drive/registerThumbnailsServices.ts b/src/apps/drive/dependency-injection/offline-drive/registerThumbnailsServices.ts index fb604cfe33..41939c910d 100644 --- a/src/apps/drive/dependency-injection/offline-drive/registerThumbnailsServices.ts +++ b/src/apps/drive/dependency-injection/offline-drive/registerThumbnailsServices.ts @@ -1,10 +1,9 @@ import { ContainerBuilder } from 'diod'; -import os from 'node:os'; -import path from 'node:path'; import { ThumbnailSynchronizer } from '../../../../context/storage/thumbnails/application/sync/ThumbnailSynchronizer'; import { LocalThumbnailRepository } from '../../../../context/storage/thumbnails/infrastructrue/local/LocalThumbnsailsRepository'; import { SystemThumbnailNameCalculator } from '../../../../context/storage/thumbnails/infrastructrue/local/SystemThumbnailNameCalculator'; import { RelativePathToAbsoluteConverter } from '../../../../context/virtual-drive/shared/application/RelativePathToAbsoluteConverter'; +import { PATHS } from '../../../../core/electron/paths'; export async function registerThumbnailsServices(builder: ContainerBuilder) { builder.registerAndUse(SystemThumbnailNameCalculator); @@ -15,7 +14,7 @@ export async function registerThumbnailsServices(builder: ContainerBuilder) { const local = new LocalThumbnailRepository( pathConverter, c.get(SystemThumbnailNameCalculator), - path.join(os.homedir(), '.cache', 'thumbnails'), + PATHS.THUMBNAILS_FOLDER, ); local.init(); diff --git a/src/apps/main/preload.d.ts b/src/apps/main/preload.d.ts index aba8bd40fa..4bb4596754 100644 --- a/src/apps/main/preload.d.ts +++ b/src/apps/main/preload.d.ts @@ -156,7 +156,6 @@ declare interface Window { onVirtualDriveStatusChange( callback: (event: { status: import('../drive/fuse/FuseDriveStatus').FuseDriveStatus }) => void, ): () => void; - retryVirtualDriveMount(): Promise; startRemoteSync: () => Promise; openUrl: (url: string) => Promise; getPreferredAppLanguage: () => Promise>; diff --git a/src/apps/main/preload.js b/src/apps/main/preload.js index 1a6dd23090..704b016a05 100644 --- a/src/apps/main/preload.js +++ b/src/apps/main/preload.js @@ -284,9 +284,6 @@ contextBridge.exposeInMainWorld('electron', { getVirtualDriveStatus() { return ipcRenderer.invoke('get-virtual-drive-status'); }, - retryVirtualDriveMount() { - return ipcRenderer.invoke('retry-virtual-drive-mount'); - }, onVirtualDriveStatusChange(callback) { const eventName = 'virtual-drive-status-change'; const callbackWrapper = (_, v) => { diff --git a/src/apps/main/types.ts b/src/apps/main/types.ts index b44aab00bb..6e07b4a148 100644 --- a/src/apps/main/types.ts +++ b/src/apps/main/types.ts @@ -1,3 +1,7 @@ +/* + TODO PB-6043: Stop using this class in favor of the real, src/infra/schemas UserDTO/UserResponseDTO + As it is the real, maintained type from the backend. + */ export type User = { backupsBucket: string; bridgeUser: string; diff --git a/src/apps/main/virtual-drive.ts b/src/apps/main/virtual-drive.ts index 6095bd6c39..4ba7b20568 100644 --- a/src/apps/main/virtual-drive.ts +++ b/src/apps/main/virtual-drive.ts @@ -1,5 +1,5 @@ import { ipcMain } from 'electron'; -import { getFuseDriveState, startVirtualDrive, stopAndClearFuseApp, stopFuse, updateFuseApp } from '../drive'; +import { getFuseDriveState, startVirtualDrive, stopAndClearFuseApp, updateFuseApp } from '../drive'; import eventBus from './event-bus'; eventBus.on('USER_LOGGED_OUT', stopAndClearFuseApp); @@ -10,8 +10,3 @@ eventBus.on('REMOTE_CHANGES_SYNCHED', updateFuseApp); ipcMain.handle('get-virtual-drive-status', () => { return getFuseDriveState(); }); - -ipcMain.handle('retry-virtual-drive-mount', async () => { - await stopFuse(); - await startVirtualDrive(); -}); diff --git a/src/apps/main/virtual-root-folder/handlers.ts b/src/apps/main/virtual-root-folder/handlers.ts index 8542d804b9..f0a8d72026 100644 --- a/src/apps/main/virtual-root-folder/handlers.ts +++ b/src/apps/main/virtual-root-folder/handlers.ts @@ -7,5 +7,3 @@ ipcMain.handle('get-virtual-drive-root', getRootVirtualDrive); ipcMain.handle('choose-sync-root-with-dialog', chooseSyncRootWithDialog); ipcMain.handle('open-virtual-drive-folder', openVirtualDriveRootFolder); - -//ipcMain.handle('retry-virtual-drive-mount', () => chooseSyncRootWithDialog); diff --git a/src/apps/renderer/hooks/useVirtualDriveStatus.tsx b/src/apps/renderer/hooks/useVirtualDriveStatus.tsx index 27578f309a..caa4e37efb 100644 --- a/src/apps/renderer/hooks/useVirtualDriveStatus.tsx +++ b/src/apps/renderer/hooks/useVirtualDriveStatus.tsx @@ -22,17 +22,5 @@ export default function useVirtualDriveStatus() { return removeListener; }, []); - function retryMount() { - window.electron - .retryVirtualDriveMount() - .then(() => { - return window.electron.getVirtualDriveStatus(); - }) - .then((status: FuseDriveStatus) => setVirtualDriveStatus(status)) - .catch((err) => { - reportError(err); - }); - } - - return { virtualDriveStatus, retryMount }; + return { virtualDriveStatus }; } diff --git a/src/context/storage/thumbnails/infrastructrue/local/SystemThumbnailNameCalculator.ts b/src/context/storage/thumbnails/infrastructrue/local/SystemThumbnailNameCalculator.ts index d7660b7cae..fc597773c6 100644 --- a/src/context/storage/thumbnails/infrastructrue/local/SystemThumbnailNameCalculator.ts +++ b/src/context/storage/thumbnails/infrastructrue/local/SystemThumbnailNameCalculator.ts @@ -1,8 +1,6 @@ import crypto from 'crypto'; import { Service } from 'diod'; -export type ThumbnailSize = 'normal' | 'large' | 'x-large' | 'xx-large'; - @Service() export class SystemThumbnailNameCalculator { thumbnailName(original: string) { diff --git a/src/core/electron/paths.ts b/src/core/electron/paths.ts index 6553a36705..84b5a7dc62 100644 --- a/src/core/electron/paths.ts +++ b/src/core/electron/paths.ts @@ -1,10 +1,12 @@ import { app } from 'electron'; -import { join } from 'path'; +import path, { join } from 'node:path'; +import os from 'node:os'; const HOME_FOLDER_PATH = app.getPath('home'); const LOGS = join(HOME_FOLDER_PATH, '.config', 'internxt', 'logs'); - +const THUMBNAILS_FOLDER = path.join(os.homedir(), '.cache', 'thumbnails'); export const PATHS = { HOME_FOLDER_PATH, LOGS, + THUMBNAILS_FOLDER, };