Fixed opening of local links from webview bots in appropriate window.
This commit is contained in:
		
							parent
							
								
									a704611705
								
							
						
					
					
						commit
						ef474f0dc8
					
				
					 1 changed files with 8 additions and 1 deletions
				
			
		|  | @ -566,9 +566,16 @@ bool AttachWebView::botHandleLocalUri(QString uri, bool keepOpen) { | ||||||
| 	if (!keepOpen) { | 	if (!keepOpen) { | ||||||
| 		botClose(); | 		botClose(); | ||||||
| 	} | 	} | ||||||
| 	crl::on_main([=, shownUrl = _lastShownUrl] { | 	crl::on_main([=, shownUrl = _lastShownUrl, bot = _bot] { | ||||||
|  | 		if (bot->session().windows().empty()) { | ||||||
|  | 			Core::App().domain().activate(&bot->session().account()); | ||||||
|  | 		} | ||||||
|  | 		const auto window = !bot->session().windows().empty() | ||||||
|  | 			? bot->session().windows().front() | ||||||
|  | 			: nullptr; | ||||||
| 		const auto variant = QVariant::fromValue(ClickHandlerContext{ | 		const auto variant = QVariant::fromValue(ClickHandlerContext{ | ||||||
| 			.attachBotWebviewUrl = shownUrl, | 			.attachBotWebviewUrl = shownUrl, | ||||||
|  | 			.sessionWindow = window, | ||||||
| 		}); | 		}); | ||||||
| 		UrlClickHandler::Open(local, variant); | 		UrlClickHandler::Open(local, variant); | ||||||
| 	}); | 	}); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 23rd
						23rd