Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
warn when WinePrefixesBasePath is empty #3948
base: main
Are you sure you want to change the base?
warn when WinePrefixesBasePath is empty #3948
Changes from all commits
0b1e1c7
17fb14e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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'm not sure whether a simple truthiness check makes sense here. Sure, if the user highlights the entire path and then deletes it, this'll work. More likely however (especially considering virtual keyboards, e.g. on the Deck), they're gonna backspace one-by-one, causing a restore operation to just re-insert the
/
. This of course won't work as a prefix path eitherThe easiest way to resolve this would be to not store the "last valid" value at all, instead just restoring it to the same path a new install would use:
HeroicGamesLauncher/src/frontend/screens/Library/components/InstallModal/WineSelector/index.tsx
Lines 70 to 73 in 47d3075
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.
Sorry if this is a silly question but I don't see where to find the original
defaultWinePrefix
? In the code you linked thesuggestedWinePrefix
is built partly thetitle
orappName
fromWineSelector
's props, which we don't have in the component we're working on... Is there something like a constants file that the initial value comes from?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.
Instead of storing
lastValidPrefix
(which the name can be a bit misleading, it doesn't mean this is valid) I imagine this logic forhandlePathChange
:But I actually think we have a problem with the PathSelectionBox component because we have no simple way of resetting the value (we would have to re-render the component cause it uses the internal tmpPath state).
I imagine the
onPathChange
function that we pass with the props could be updated to return a string (instead of void) that the component should set the field to, and instead of simply calling that function in theonBlur
callback, we could wrap it to call it and use the return value to update withsetTmpPath(theReturnValueOfOnPathChange)
.