diff --git a/public/electron-app.js b/public/electron-app.js index b3912f2c..c1ed5b7d 100644 --- a/public/electron-app.js +++ b/public/electron-app.js @@ -1,12 +1,12 @@ require('dotenv').config(); +const path = require('path'); const { app, Tray } = require('electron'); const isDev = require('electron-is-dev'); const DaemonProcess = require('./electron/daemon'); const registerEvents = require('./electron/events'); const createMainWindow = require('./electron/window/main'); -const createSplashWindow = require('./electron/window/splash'); const { getMenuOptions, trayIcon } = require('./electron/tray-menu'); let appIcon; @@ -21,6 +21,8 @@ const enableDevDaemon = process.env.DEV_DAEMON === 'true'; * App events */ app.on('window-all-closed', () => { + // eslint-disable-next-line no-console + console.log('All windows are closed...'); destroyStream(); if (process.platform !== 'darwin' || app.newUpdate) { @@ -43,12 +45,14 @@ app.on('activate', () => { }); app.on('before-quit', () => { + // eslint-disable-next-line no-console + console.log('App is quiting...'); daemon.stop(); app.quitting = true; }); app.on('ready', () => { - mainWindow = createSplashWindow(); + mainWindow = createMainWindow(); const contextMenu = getMenuOptions(app, 'pending'); @@ -60,9 +64,9 @@ app.on('ready', () => { * Daemon Event handlers */ daemon.on('ready', () => { - const prevWindow = mainWindow; - - mainWindow = createMainWindow(); + mainWindow.loadURL(isDev + ? 'http://localhost:3000' + : `file://${path.join(__dirname, '../build/index.html')}`); mainWindow.on('closed', () => { mainWindow = null; @@ -77,8 +81,6 @@ daemon.on('ready', () => { } }); - prevWindow.destroy(); - destroyStream = registerEvents({ app, isDev, @@ -98,5 +100,4 @@ if (isDev && !enableDevDaemon) { daemon.startDev(); return; } - daemon.start(); diff --git a/public/electron/events/app-update.js b/public/electron/events/app-update.js index c99489fd..b8a0965e 100644 --- a/public/electron/events/app-update.js +++ b/public/electron/events/app-update.js @@ -24,7 +24,7 @@ const registerAppUpdateEvents = ({ }); } catch (error) { // eslint-disable-next-line no-console - console.error(`Errror when try to check for updates: ${error.stack || error.message}`); + console.error(`Errror when try to check for updates: ${error.message}`); } }; diff --git a/public/electron/window/main.js b/public/electron/window/main.js index 8c5f3636..6bcf299b 100644 --- a/public/electron/window/main.js +++ b/public/electron/window/main.js @@ -6,14 +6,15 @@ const isMac = process.platform === 'darwin'; const createWindow = () => { const url = isDev - ? 'http://localhost:3000' - : `file://${path.join(__dirname, '../../../build/index.html')}`; + ? 'http://localhost:3000/#/splash' + : `file://${path.join(__dirname, '../../../build/index.html#/splash')}`; const win = new BrowserWindow({ width: 1200, height: 680, minWidth: 680, minHeight: 500, + backgroundColor: '#000000', titleBarStyle: isMac ? 'hiddenInset' : undefined, icon: path.join(__dirname, '..', '..', 'icon.png'), webPreferences: { diff --git a/public/electron/window/splash.js b/public/electron/window/splash.js deleted file mode 100644 index 09d1ec80..00000000 --- a/public/electron/window/splash.js +++ /dev/null @@ -1,29 +0,0 @@ -const path = require('path'); -const isDev = require('electron-is-dev'); -const { BrowserWindow } = require('electron'); - -const createWindow = () => { - const url = isDev - ? 'http://localhost:3000/#/splash' - : `file://${path.join(__dirname, '../../../build/index.html#/splash')}`; - - const win = new BrowserWindow({ - width: 400, - height: 400, - frame: false, - minWidth: 400, - minHeight: 400, - icon: path.join(__dirname, '..', '..', 'icon.png'), - webPreferences: { - webSecurity: false, - nodeIntegration: true, - preload: path.join(__dirname, '..', '..', 'preload.js'), - }, - }); - - win.loadURL(url); - - return win; -}; - -module.exports = createWindow; diff --git a/src/shared/components/Layout/components/DetailsPanel/components/CollaboratorList/index.js b/src/shared/components/Layout/components/DetailsPanel/components/CollaboratorList/index.js index e4531d6b..80cd72f6 100644 --- a/src/shared/components/Layout/components/DetailsPanel/components/CollaboratorList/index.js +++ b/src/shared/components/Layout/components/DetailsPanel/components/CollaboratorList/index.js @@ -37,60 +37,6 @@ const SharePanel = ({ t }) => { { username: 'sddavcsdgdfhfhjhmfhjsrgdfb', }, - { - username: 'zxczxcasdasdaczxcasdasdaczxas', - }, - { - username: 'someuser1asdasdzcxc', - }, - { - username: '4retxcssdsd', - }, - { - username: 'xzcasd', - }, - { - username: 'pfdoggohikjym', - }, - { - username: 'asdxcasd', - }, - { - username: 'hjgtybb', - }, - { - username: 'zxczxcasdasdasdaczxas', - }, - { - username: 'sobbvbasdasdzcxc', - }, - { - username: '4regjfghjssdsd', - }, - { - username: 'xzcasdvbdsfs45', - }, - { - username: 'bnsiduyty', - }, - { - username: 'zxcsffhgfhher', - }, - { - username: 'bvsdfs', - }, - { - username: 'cxvcxvsd', - }, - { - username: 'dflgkwer', - }, - { - username: 'xcvoiiuyen', - }, - { - username: 'dfrtrtmm', - }, ], })); @@ -196,8 +142,11 @@ const SharePanel = ({ t }) => { return newArray.concat(collaborator); } - // eslint-disable-next-line no-param-reassign - newArray[newArray.length - 1].username = t('detailsPanel.share.group', { number: index - state.maxCollaborators + 2 }); + if (newArray.length) { + // eslint-disable-next-line no-param-reassign + newArray[newArray.length - 1].username = t('detailsPanel.share.group', { number: index - state.maxCollaborators + 2 }); + } + return newArray; }, []) .map((collaborator, index, arr) => ( diff --git a/src/views/Storage/Files/components/FileTable/FileTable.js b/src/views/Storage/Files/components/FileTable/FileTable.js index 91d19739..9a2d71d8 100644 --- a/src/views/Storage/Files/components/FileTable/FileTable.js +++ b/src/views/Storage/Files/components/FileTable/FileTable.js @@ -181,7 +181,7 @@ const FileTable = () => { return () => { document.removeEventListener('click', handleTableOutsideClick); }; - }, [rows.length]); + }, [rows]); return (