-
-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleanup platform
checks. Remove old code.
#3477
Conversation
const platform = await page.evaluate(async () => window.api.getPlatform()) | ||
console.log('Platform: ', platform) | ||
expect(platform).toEqual(process.platform) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this test because I removed the getPlatform
function, that info is now exposed in the preload.ts file so we don't need an extra call to the backend
await libraryManagerMap['legendary'].refresh() | ||
return LegendaryLibraryManager.getListOfGames() | ||
} | ||
const userInfo = await LegendaryUser.getUserInfo() | ||
const userInfo = LegendaryUser.getUserInfo() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this await was not needed, the linter was flagging it
ipcMain.handle('readConfig', async (event, config_class) => { | ||
if (config_class === 'library') { | ||
ipcMain.handle('readConfig', async (event, configClass) => { | ||
if (configClass === 'library') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just to follow conventions
@@ -696,19 +696,6 @@ export async function getInstallInfo( | |||
} | |||
} | |||
installInfoStore.set(installInfoStoreKey, info) | |||
if (!info) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few lines above we do const info = { ..... }
, I couldn't find any way this could be false since it's defined right before this line
@@ -115,26 +115,6 @@ export class GOGUser { | |||
return JSON.parse(stdout) | |||
} | |||
|
|||
/** | |||
* Migrates existing authorization config to one supported by gogdl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked with linguin, we don't need this anymore, it was here temporarily to migrate credentials over a few releases
if (isWindows) { | ||
detectVCRedist(mainWindow) | ||
} | ||
detectVCRedist(mainWindow) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
detectVCRedist
already checks if isWindows
inside the function
if (!currentConfigStore?.defaultInstallPath) { | ||
configStore.set('settings', settings) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not needed anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR does 3 cleanup/refactor tasks:
isWindows/Linux/Mac
constants when possible instead ofprocess.platform
orplatform()
Use the following Checklist if you have changed something on the Backend or Frontend: