Skip to content

Fix installer dialogs that remain open after confirmation - #913

Open
bubblegump30 wants to merge 1 commit into
SteamClientHomebrew:mainfrom
bubblegump30:fix/installer-dialog-dismissal
Open

bubblegump30 wants to merge 1 commit into
SteamClientHomebrew:mainfrom
bubblegump30:fix/installer-dialog-dismissal

Conversation

@bubblegump30

@bubblegump30 bubblegump30 commented Sep 28, 2026 •

Copy link
Copy Markdown
 * @param onStateSetter Called with the modal's state setter once the component
 *   mounts — lets the caller swap content without touching pluginSelf.
 */
async PromptInstallation(type: InstallType, data: any, onStateSetter: (setter: (el: React.ReactElement) => void) => void): Promise<ShowModalResult> {
async PromptInstallation(type: InstallType, data: any, onStateSetter: (setter: (el: React.ReactElement) => void) => void): Promise<ShowModalResult | null> {
	const itemName = (type === InstallType.Plugin ? data?.pluginJson?.common_name : data?.name) ?? locale.strUnknown;

	return new Promise((resolve) => {
					onOK={() => resolve(modal)}
					bHideCloseIcon={true}
					closeModal={() => {}}
					onCancel={() => modal?.Close()}
					onCancel={() => {
						modal?.Close();
						resolve(null);
					}}
				/>,
			);


	function ShowMessageBox(message: React.ReactNode, title: React.ReactNode, props?: ConfirmModalProps) {
		return new Promise((resolve) => {
			let standaloneModal: ShowModalResult | undefined;
			const handle = (result: boolean, cb?: () => void) => {
				cb?.();
				// A message with no custom action is terminal. The installer owns
				// this modal, so Steam cannot dismiss it automatically.
				if (!cb) {
					(updateInstallerState ? modal : standaloneModal)?.Close();
				}
				resolve(result);
			};

			if (updateInstallerState) {
				updateInstallerState(element);
			} else {
				showModal(element, pluginSelf.mainWindow, {
				standaloneModal = showModal(element, pluginSelf.mainWindow, {
					bNeverPopOut: true,
					popupWidth: 500,
					popupHeight: 275,
		modal = await this.PromptInstallation(type, data, (setter) => {
			updateInstallerState = setter;
		});
		if (!modal) return;

		// updateInstallerState is guaranteed set here — the Renderer useEffect
		// fires before the user can click OK.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant