Skip to content
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

[UI] Show if there is enough space available on Install #1336

Merged
merged 12 commits into from
May 19, 2022

Conversation

flavioislima
Copy link
Member

@flavioislima flavioislima commented May 18, 2022

I fixed the error handler on the backend but the main check now is on the frontend.

I will check if there enough space and if the path is writable, if not, then the Install Button will be disabled.

Linux/Mac
image
image
image

Windows:
image
image


Use the following Checklist if you have changed something on the Backend or Frontend:

  • Tested the feature and it's working on a current and clean install.
  • Tested the main App features and they are still working on a current and clean install. (Login, Install, Play, Uninstall, Move games, etc.)
  • Created / Updated Tests (If necessary)
  • Created / Updated documentation (If necessary)

@flavioislima flavioislima added the pr:ready-for-review Feature-complete, ready for the grind! :P label May 18, 2022
@flavioislima flavioislima linked an issue May 18, 2022 that may be closed by this pull request
electron/main.ts Outdated
const { free, size: diskSize } = await checkDiskSpace(folder)
return `${getFileSize(free)}/${getFileSize(diskSize)}`
ipcMain.handle('checkDiskSpace', async (event, folder: string) => {
if (folder.startsWith('/')) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just wondering, does this work on windows? looks like unix specific

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, won't work. I will figure out another way of checking that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So actualy the function checkDiskSpace checks if the path is valid based on the platform so we dont need to do it ourselves.
So I just changed it to a try catch now.

@flavioislima flavioislima merged commit 8f715c8 into main May 19, 2022
@flavioislima flavioislima deleted the fix_space_check branch May 19, 2022 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:ready-for-review Feature-complete, ready for the grind! :P
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warning for "not enough disk space" does not appear on macOS
2 participants