+
+
+
diff --git a/src/apps/renderer/hooks/ClientPlatform.tsx b/src/apps/renderer/hooks/ClientPlatform.tsx
deleted file mode 100644
index 1f7e7336c2..0000000000
--- a/src/apps/renderer/hooks/ClientPlatform.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import { useEffect, useState } from 'react';
-
-import { DesktopPlatform } from '../../main/platform/DesktopPlatform';
-
-export default function useClientPlatform(): DesktopPlatform | undefined {
- const [clientPlatform, setPlatform] = useState();
-
- useEffect(() => {
- window.electron.getPlatform().then(setPlatform);
- }, []);
-
- return clientPlatform;
-}
diff --git a/src/apps/renderer/localize/locales/en.json b/src/apps/renderer/localize/locales/en.json
index fc2e29ea8d..a8cc8c16c9 100644
--- a/src/apps/renderer/localize/locales/en.json
+++ b/src/apps/renderer/localize/locales/en.json
@@ -68,11 +68,7 @@
"skip": "Skip",
"open-drive": "Open Internxt Drive",
"new": "New",
- "platform-phrase": {
- "windows": "file explorer",
- "linux": "file browser",
- "macos": "Finder"
- }
+ "platform-phrase": "file explorer"
}
},
"migration": {
diff --git a/src/apps/renderer/localize/locales/es.json b/src/apps/renderer/localize/locales/es.json
index f87fb003b9..685e7967a1 100644
--- a/src/apps/renderer/localize/locales/es.json
+++ b/src/apps/renderer/localize/locales/es.json
@@ -68,11 +68,7 @@
"open-drive": "Abrir Internxt Drive",
"skip": "Saltar",
"new": "Nuevo",
- "platform-phrase": {
- "windows": "explorador de archivos",
- "linux": "buscador de archivos",
- "macos": "Finder"
- }
+ "platform-phrase": "explorador de archivos"
}
},
"migration": {
diff --git a/src/apps/renderer/localize/locales/fr.json b/src/apps/renderer/localize/locales/fr.json
index d678d68a6c..173d2533d0 100644
--- a/src/apps/renderer/localize/locales/fr.json
+++ b/src/apps/renderer/localize/locales/fr.json
@@ -68,11 +68,7 @@
"continue": "Continuer",
"skip": "Sauter",
"new": "Nouveau",
- "platform-phrase": {
- "windows": "navigateur de fichiers",
- "linux": "navigateur de fichiers",
- "macos": "Finder"
- }
+ "platform-phrase": "navigateur de fichiers"
}
},
"migration": {
diff --git a/src/apps/renderer/pages/Onboarding/helpers.tsx b/src/apps/renderer/pages/Onboarding/helpers.tsx
index 6bf237459d..f20919608b 100644
--- a/src/apps/renderer/pages/Onboarding/helpers.tsx
+++ b/src/apps/renderer/pages/Onboarding/helpers.tsx
@@ -9,7 +9,6 @@ export type OnboardingSlideProps = {
backupFolders: BackupFolder[];
currentSlide: number;
totalSlides: number;
- platform: string;
};
export type OnboardingSlide = {
diff --git a/src/apps/renderer/pages/Onboarding/index.tsx b/src/apps/renderer/pages/Onboarding/index.tsx
index b7975673b3..a532f32e8e 100644
--- a/src/apps/renderer/pages/Onboarding/index.tsx
+++ b/src/apps/renderer/pages/Onboarding/index.tsx
@@ -1,7 +1,6 @@
import { useMemo, useState } from 'react';
import { SLIDES } from './config';
import { BackupFolder, BackupsFoldersSelector } from '../../components/Backups/BackupsFoldersSelector';
-import useClientPlatform from '../../hooks/ClientPlatform';
// Slide 1 is welcome slide, last slide is summary, doesn't count
const totalSlides = SLIDES.length - 2;
@@ -10,7 +9,6 @@ export default function Onboarding() {
const [backupFolders, setBackupFolders] = useState([]);
const [slideIndex, setSlideIndex] = useState(0);
const [backupsModalOpen, setBackupsModalOpen] = useState(false);
- const desktopPlatform = useClientPlatform();
const finish = () => {
if (backupFolders?.length) {
@@ -19,9 +17,11 @@ export default function Onboarding() {
* if this fails, the user can fix this
* from the Desktop settings
*/
- window.electron.addBackupsFromLocalPaths(backupFolders.map((backupFolder) => backupFolder.path)).catch((err) => {
- reportError(err);
- });
+ window.electron
+ .addBackupsFromLocalPaths(backupFolders.map((backupFolder) => backupFolder.path))
+ .catch((err: unknown) => {
+ reportError(err);
+ });
}
window.electron.finishOnboarding();
@@ -64,12 +64,10 @@ export default function Onboarding() {
}, 300);
};
- if (!desktopPlatform) return <>>;
return (
= () => {
{translate('onboarding.slides.drive.description', {
- platform_app: translate('onboarding.common.platform-phrase.windows'),
+ platform_app: translate('onboarding.common.platform-phrase'),
})}
diff --git a/src/apps/renderer/pages/Onboarding/slides/onboarding-completed-slide.tsx b/src/apps/renderer/pages/Onboarding/slides/onboarding-completed-slide.tsx
index e916aea62a..2a8558886f 100644
--- a/src/apps/renderer/pages/Onboarding/slides/onboarding-completed-slide.tsx
+++ b/src/apps/renderer/pages/Onboarding/slides/onboarding-completed-slide.tsx
@@ -23,7 +23,7 @@ export const OnboardingCompletedSlide: React.FC
= () => {
{translate('onboarding.slides.onboarding-completed.desktop-ready.description', {
- platform_phrase: translate('onboarding.common.platform-phrase.windows'),
+ platform_phrase: translate('onboarding.common.platform-phrase'),
})}
diff --git a/src/context/virtual-drive/shared/application/PlatformPathConverter.test.ts b/src/context/virtual-drive/shared/application/PlatformPathConverter.test.ts
deleted file mode 100644
index 22301b8179..0000000000
--- a/src/context/virtual-drive/shared/application/PlatformPathConverter.test.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { PlatformPathConverter } from './PlatformPathConverter';
-
-describe('PlatformPathConverter', () => {
- describe('winToPosix', () => {
- it('works with a single level', () => {
- const win = '\\New Folder (4)';
- const posix = PlatformPathConverter.winToPosix(win);
-
- expect(posix).toBe('/New Folder (4)');
- });
- it('works with two levels', () => {
- const win = '\\New Folder (4)\\Subfolder';
- const posix = PlatformPathConverter.winToPosix(win);
-
- expect(posix).toBe('/New Folder (4)/Subfolder');
- });
- });
-});
diff --git a/src/context/virtual-drive/shared/application/PlatformPathConverter.ts b/src/context/virtual-drive/shared/application/PlatformPathConverter.ts
deleted file mode 100644
index 58bebe8eaf..0000000000
--- a/src/context/virtual-drive/shared/application/PlatformPathConverter.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import path from 'path';
-
-export class PlatformPathConverter {
- static convertAnyToCurrent(anyPlatformPath: string): string {
- const fromPlatform = anyPlatformPath.includes(path.posix.sep) ? path.posix : path.win32;
-
- const toPlatform = path.sep === path.posix.sep ? path.posix : path.win32;
-
- return anyPlatformPath.split(fromPlatform.sep).join(toPlatform.sep);
- }
-
- static winToPosix(win: string): string {
- return win.split(path.win32.sep).join(path.posix.sep);
- }
-
- static posixToWin(posix: string): string {
- return posix.split(path.posix.sep).join(path.win32.sep);
- }
-
- static getFatherPathPosix(posixPath: string): string {
- const pathArray = posixPath.split('/');
- pathArray.pop();
- const parentPath = pathArray.join('/');
- return this.winToPosix(parentPath);
- }
-}