Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions .erb/scripts/electron-rebuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,11 @@ if (
Object.keys(dependencies || {}).length > 0 &&
fs.existsSync(path.join(webpackPaths.rootPath, 'node_modules'))
) {
const electronRebuildCmd =
'./node_modules/.bin/electron-rebuild --sequential --force --types prod,dev,optional --module-dir .';
const cmd =
process.platform === 'win32'
? electronRebuildCmd.replace(/\//g, '\\')
: electronRebuildCmd;
execSync(cmd, {
execSync(
'./node_modules/.bin/electron-rebuild --sequential --force --types prod,dev,optional --module-dir .',
{
cwd: webpackPaths.rootPath,
stdio: 'inherit',
});
}
);
}
10 changes: 0 additions & 10 deletions assets/entitlements.mac.plist

This file was deleted.

2 changes: 1 addition & 1 deletion knip.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"ignore": ["**/*.test.{ts,tsx}"],
"ignoreBinaries": ["esbuild"],
"ignoreExportsUsedInFile": true,
"project": ["src/**/*.{ts,tsx}"],
"project": ["src/**/*.{ts,tsx}", "!src/**/*.test.{ts,tsx}"],
"vitest": false,
"webpack": false,
"rules": {
Expand Down
71 changes: 0 additions & 71 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@
"electron-builder": "^23.6.0",
"electron-debug": "^3.2.0",
"electron-fetch": "^1.9.1",
"electron-notarize": "^1.1.1",
"electron-rebuild": "^3.2.9",
"electron-store": "^8.0.1",
"eslint": "^8.5.0",
Expand Down
6 changes: 6 additions & 0 deletions src/apps/main/interface.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ export interface IElectronAPI {

abortDownloadBackups: (deviceId: string) => void;

addBackupsFromLocalPaths: (folderPaths: string[]) => Promise<void>;

renameDevice: (deviceName: string) => Promise<Device>;
devices: {
getDevices: () => Promise<Array<Device>>;
Expand All @@ -64,6 +66,10 @@ export interface IElectronAPI {

onUserLoggedInChanged(func: (value: boolean) => void): void;

closeWindow(): void;

minimizeWindow(): void;

onRemoteChanges(func: (value: import('../main/realtime').EventPayload) => void): () => void;

openVirtualDriveFolder(): Promise<void>;
Expand Down
1 change: 0 additions & 1 deletion src/apps/main/platform/DesktopPlatform.ts

This file was deleted.

22 changes: 6 additions & 16 deletions src/apps/main/platform/handlers.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
import { ipcMain, shell } from 'electron';
import { ipcMain } from 'electron';
import { exec } from 'child_process';

ipcMain.handle('get-platform', () => {
return process.platform;
});

ipcMain.handle('open-url', (_, url: string) => {
if (process.platform === 'linux') {
// shell.openExternal is not working as intended on the current verions of electron
// this is only a workaround to fix it
return new Promise<void>((resolve, reject) => {
exec(`xdg-open ${url} &`, (error) => {
if (error) reject(error);
return new Promise<void>((resolve, reject) => {
exec(`xdg-open ${url} &`, (error) => {
if (error) reject(error);

resolve();
});
resolve();
});
}

return shell.openExternal(url);
});
});
1 change: 0 additions & 1 deletion src/apps/main/preload.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ declare interface Window {

getUsage: () => Promise<import('../../backend/features/usage/usage.types').Usage>;

getPlatform: () => Promise<import('../main/platform/DesktopPlatform').DesktopPlatform>;
onRemoteSyncStatusChange(callback: (status: import('./remote-sync/helpers').RemoteSyncStatus) => void): () => void;
getRemoteSyncStatus(): Promise<import('./remote-sync/helpers').RemoteSyncStatus>;
getVirtualDriveStatus(): Promise<import('../drive/fuse/FuseDriveStatus').FuseDriveStatus>;
Expand Down
3 changes: 0 additions & 3 deletions src/apps/main/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,6 @@ contextBridge.exposeInMainWorld('electron', {
getUsage() {
return ipcRenderer.invoke('get-usage');
},
getPlatform() {
return ipcRenderer.invoke('get-platform');
},
resizeWindow(dimensions) {
return ipcRenderer.invoke('resize-focused-window', dimensions);
},
Expand Down
3 changes: 1 addition & 2 deletions src/apps/main/windows/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ export const createAuthWindow = async () => {
nodeIntegration: true,
devTools: isDev(),
},
titleBarStyle: process.platform === 'darwin' ? 'hidden' : undefined,
frame: process.platform !== 'darwin' ? false : undefined,
frame: false,
resizable: false,
maximizable: false,
skipTaskbar: true,
Expand Down
3 changes: 1 addition & 2 deletions src/apps/main/windows/onboarding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ export const openOnboardingWindow = () => {
nodeIntegration: true,
devTools: isDev(),
},
titleBarStyle: process.platform === 'darwin' ? 'hidden' : undefined,
frame: process.platform !== 'darwin' ? false : undefined,
frame: false,
resizable: false,
maximizable: false,
});
Expand Down
3 changes: 1 addition & 2 deletions src/apps/main/windows/process-issues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ async function openProcessIssuesWindow() {
nodeIntegration: true,
devTools: isDev(),
},
titleBarStyle: process.platform === 'darwin' ? 'hidden' : undefined,
frame: process.platform !== 'darwin' ? false : undefined,
frame: false,
resizable: false,
maximizable: false,
});
Expand Down
3 changes: 1 addition & 2 deletions src/apps/main/windows/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ async function openSettingsWindow(section?: string) {
nodeIntegration: true,
devTools: isDev(),
},
titleBarStyle: process.platform === 'darwin' ? 'hidden' : undefined,
frame: process.platform !== 'darwin' ? false : undefined,
frame: false,
resizable: false,
maximizable: false,
});
Expand Down
21 changes: 8 additions & 13 deletions src/apps/renderer/components/WindowTopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,14 @@ import { X } from '@phosphor-icons/react';

export default function WindowTopBar({ title, className }: { title: string; className?: string }) {
return (
<div
className={`draggable relative flex-shrink-0 flex-grow-0 truncate px-1 ${
process.env.platform !== 'darwin' ? 'h-10' : 'h-8'
} ${className ?? ''}`}>
{process.env.platform !== 'darwin' && (
<div
role="button"
tabIndex={0}
onClick={window.electron.closeWindow}
className="non-draggable absolute right-0 top-0 flex h-10 items-center justify-center px-3 text-gray-60 hover:bg-red hover:text-white">
<X size={20} />
</div>
)}
<div className={`draggable relative h-10 flex-shrink-0 flex-grow-0 truncate px-1 ${className ?? ''}`}>
<div
role="button"
tabIndex={0}
onClick={window.electron.closeWindow}
className="non-draggable absolute right-0 top-0 flex h-10 items-center justify-center px-3 text-gray-60 hover:bg-red hover:text-white">
<X size={20} />
</div>
<p
className="absolute left-1/2 flex h-full -translate-x-1/2 transform items-center truncate text-sm text-gray-80"
data-test="window-top-bar-title">
Expand Down
13 changes: 0 additions & 13 deletions src/apps/renderer/hooks/ClientPlatform.tsx

This file was deleted.

6 changes: 1 addition & 5 deletions src/apps/renderer/localize/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
6 changes: 1 addition & 5 deletions src/apps/renderer/localize/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
6 changes: 1 addition & 5 deletions src/apps/renderer/localize/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
1 change: 0 additions & 1 deletion src/apps/renderer/pages/Onboarding/helpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export type OnboardingSlideProps = {
backupFolders: BackupFolder[];
currentSlide: number;
totalSlides: number;
platform: string;
};

export type OnboardingSlide = {
Expand Down
Loading
Loading