Implement "Report Issue" button (#634)

Currently, "Report an Issue" button, which can be found in the `ModInfoPopup` if `mod.json` contains `issues` property, doesn't do anything useful except opening crashlog directory.
This changes it to actually open the specified URL in browser / crashlogs directory, instead of both buttons having the same action.
This commit is contained in:
Oleksandr Nemesh 2024-03-25 21:43:24 +02:00 committed by GitHub
parent 223f168fb0
commit 9362df6078
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -23,7 +23,16 @@ void geode::openIssueReportPopup(Mod* mod) {
dirs::getCrashlogsDir().string() + "`", dirs::getCrashlogsDir().string() + "`",
"OK", "Open Folder", "OK", "Open Folder",
[mod](bool btn2) { [mod](bool btn2) {
if (btn2) {
file::openFolder(dirs::getCrashlogsDir()); file::openFolder(dirs::getCrashlogsDir());
return;
}
auto issues = mod->getMetadata().getIssues();
if (issues && issues.value().url) {
auto url = issues.value().url.value();
web::openLinkInBrowser(url);
}
} }
)->show(); )->show();
} }