1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

OnlineUnlockForm: Fix scope of AlertWindow so that it outlives the OverlayComp

This commit is contained in:
reuk 2023-09-08 19:54:14 +01:00
parent 3540152d71
commit aec8617f59
No known key found for this signature in database
GPG key ID: FCB43929F012EE5C
2 changed files with 9 additions and 5 deletions

View file

@ -102,15 +102,19 @@ struct OnlineUnlockForm::OverlayComp : public Component,
{
auto options = MessageBoxOptions::makeOptionsOk (MessageBoxIconType::WarningIcon,
TRANS ("Registration Failed"),
result.errorMessage);
messageBox = AlertWindow::showScopedAsync (options, nullptr);
result.errorMessage,
{},
&form);
form.messageBox = AlertWindow::showScopedAsync (options, nullptr);
}
else if (result.informativeMessage.isNotEmpty())
{
auto options = MessageBoxOptions::makeOptionsOk (MessageBoxIconType::InfoIcon,
TRANS ("Registration Complete!"),
result.informativeMessage);
messageBox = AlertWindow::showScopedAsync (options, nullptr);
result.informativeMessage,
{},
&form);
form.messageBox = AlertWindow::showScopedAsync (options, nullptr);
}
else if (result.urlToLaunch.isNotEmpty())
{
@ -145,7 +149,6 @@ struct OnlineUnlockForm::OverlayComp : public Component,
Spinner spinner;
OnlineUnlockStatus::UnlockResult result;
String email, password;
ScopedMessageBox messageBox;
std::unique_ptr<TextButton> cancelButton;

View file

@ -87,6 +87,7 @@ private:
struct OverlayComp;
friend struct OverlayComp;
ScopedMessageBox messageBox;
Component::SafePointer<Component> unlockingOverlay;
void buttonClicked (Button*) override;