From 194fa0c9b1da840b7f83b2d32a0d901587f59644 Mon Sep 17 00:00:00 2001 From: gdbroman <99gustaf@gmail.com> Date: Thu, 13 Jul 2023 21:25:48 +0200 Subject: [PATCH 1/3] Take out clearUserData for now --- app/src/main/helpers/clearUserData.ts | 22 ---------------------- app/src/main/main.ts | 24 ------------------------ 2 files changed, 46 deletions(-) delete mode 100644 app/src/main/helpers/clearUserData.ts diff --git a/app/src/main/helpers/clearUserData.ts b/app/src/main/helpers/clearUserData.ts deleted file mode 100644 index 19d9b12687..0000000000 --- a/app/src/main/helpers/clearUserData.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { app } from 'electron'; -import log from 'electron-log'; -import fs from 'fs'; -import { rimrafSync } from 'rimraf'; - -/** - * Clears the cache for the current user. - * Used so new versions of the app can be tested without interference from - * previous versions. - * - * On Mac, cache is stored in ~/Library/Application Support/@holium - * On Windows, cache is stored in %APPDATA%/@holium - * On Linux, cache is stored in ~/.config/@holium - */ -export const clearUserData = () => { - const userDataPath = app.getPath('userData'); - - if (fs.existsSync(userDataPath)) { - log.info('Clearing user data:', userDataPath); - rimrafSync(userDataPath); - } -}; diff --git a/app/src/main/main.ts b/app/src/main/main.ts index 736cbd5a11..647cfdb238 100644 --- a/app/src/main/main.ts +++ b/app/src/main/main.ts @@ -1,10 +1,8 @@ import { app, BrowserWindow, Menu, MenuItem, nativeImage } from 'electron'; -import log from 'electron-log'; import Store from 'electron-store'; import { RealmService } from '../os/realm.service'; import { AppUpdater } from './AppUpdater'; -import { clearUserData } from './helpers/clearUserData'; import { setRealmCursor } from './helpers/cursorSettings'; import { isMac, isMacWithCameraNotch } from './helpers/env'; import { windowWindow } from './helpers/fullscreen'; @@ -58,28 +56,6 @@ const updateMacDockMenu = ( }; export const bootRealm = () => { - const storedRealmRelease = store.get('realmRelease'); - const currentRealmRelease = app.getVersion(); - - if ( - Boolean(storedRealmRelease) && - storedRealmRelease !== currentRealmRelease - ) { - // If the stored realmRelease is different from the current realmRelease, - // it means the user has had Realm uninstalled for a while and is now - // reinstalling it, since it otherwise would have been updated by AppUpdater. - // In this case, we want to clear the user data. - log.info( - 'Booting a Realm version different from stored user data:', - storedRealmRelease, - 'vs.', - currentRealmRelease - ); - clearUserData(); - } else { - log.info('Booting a Realm version compatible with stored user data.'); - } - store.set('isStandaloneChat', false); if (!realmService) { From d3ee029642ec60020bc7ce4df97e86bfa1d2372b Mon Sep 17 00:00:00 2001 From: gdbroman <99gustaf@gmail.com> Date: Thu, 13 Jul 2023 21:51:18 +0200 Subject: [PATCH 2/3] Don't remove onMouseDown/onMouseUp in appgrid (disables scrolling) --- .../renderer/system/desktop/components/Home/Ship/AppGrid.tsx | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/src/renderer/system/desktop/components/Home/Ship/AppGrid.tsx b/app/src/renderer/system/desktop/components/Home/Ship/AppGrid.tsx index f586116a73..4346ed59fb 100644 --- a/app/src/renderer/system/desktop/components/Home/Ship/AppGrid.tsx +++ b/app/src/renderer/system/desktop/components/Home/Ship/AppGrid.tsx @@ -46,11 +46,6 @@ const AppGridPresenter = ({ maxWidth }: AppGridProps) => { window.electron.app.onMouseUp(() => { canClick.setToggle(true); }); - - return () => { - window.electron.app.removeOnMouseMove(); - window.electron.app.removeOnMouseUp(); - }; }, []); if (!currentSpace) return null; From 1e474ba9d9ff0d14591e00c03775048ec2c7d98d Mon Sep 17 00:00:00 2001 From: gdbroman <99gustaf@gmail.com> Date: Thu, 13 Jul 2023 22:02:47 +0200 Subject: [PATCH 3/3] Convert map to foreach --- .../renderer/system/desktop/components/Home/Ship/AppGrid.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/renderer/system/desktop/components/Home/Ship/AppGrid.tsx b/app/src/renderer/system/desktop/components/Home/Ship/AppGrid.tsx index 4346ed59fb..656d17837e 100644 --- a/app/src/renderer/system/desktop/components/Home/Ship/AppGrid.tsx +++ b/app/src/renderer/system/desktop/components/Home/Ship/AppGrid.tsx @@ -60,8 +60,7 @@ const AppGridPresenter = ({ maxWidth }: AppGridProps) => { setItems(nextState); const newGrid = Object(); - // eslint-disable-next-line array-callback-return - nextState.map((app, index: number) => { + nextState.forEach((app, index: number) => { newGrid[index] = app.id; }); bazaarStore.reorderApp(sourceIndex, targetIndex, newGrid);