[DeckShare] Resolve the stable server client in the deck editor gate

actShareDeck went through tabSupervisor->getClient(), which hands back a
LocalClient while an offline game is running. LocalClient never sets its status,
so a logged-in user could not share from the deck editor during a local game,
and got a misleading "You must be connected" message. Expose the supervisor's
stable remote client and use it for the gate and the dialog, matching the other
share tabs.
This commit is contained in:
Lukas Brübach 2026-09-20 19:28:53 +02:00 committed by GitHub
parent 64335328c3
commit c4ffc789cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View file

@ -388,7 +388,8 @@ bool AbstractTabDeckEditor::actSaveDeckAs()
*/
void AbstractTabDeckEditor::actShareDeck()
{
if (tabSupervisor->getClient()->getStatus() != StatusLoggedIn) {
AbstractClient *client = tabSupervisor->getServerClient();
if (client->getStatus() != StatusLoggedIn) {
QMessageBox::information(this, tr("Share deck"), tr("You must be connected to the server to share a deck."));
return;
}
@ -399,7 +400,7 @@ void AbstractTabDeckEditor::actShareDeck()
return;
}
DlgShareDeck shareDialog(tabSupervisor->getClient(), deck, this);
DlgShareDeck shareDialog(client, deck, this);
shareDialog.exec();
}

View file

@ -152,6 +152,10 @@ public:
return userInfo;
}
[[nodiscard]] AbstractClient *getClient() const;
[[nodiscard]] AbstractClient *getServerClient() const
{
return client;
}
[[nodiscard]] UserListManager *getUserListManager() const
{
return userListManager;