Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Geometrically committed Aug 29, 2024
1 parent 19094ad commit ae38853
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions apps/app/src/api/ads.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,23 @@ pub async fn init_ads_window<R: Runtime>(
if let Some(webview) = app.webviews().get("ads-window") {
let _ = webview.set_position(LogicalPosition::new(x, y));
let _ = webview.set_size(LogicalSize::new(width, height));
} else {
if let Some(window) = app.get_window("main") {
let _ = window.add_child(
tauri::webview::WebviewBuilder::new(
"ads-window",
WebviewUrl::External(
"http://localhost:3000/promo-frame.html"
.parse()
.unwrap(),
),
)
.initialization_script(LINK_SCRIPT)
.user_agent("ModrinthApp Ads Webview")
.zoom_hotkeys_enabled(false)
.transparent(true),
LogicalPosition::new(x, y),
LogicalSize::new(width, height),
);
}
} else if let Some(window) = app.get_window("main") {
let _ = window.add_child(
tauri::webview::WebviewBuilder::new(
"ads-window",
WebviewUrl::External(
"http://localhost:3000/promo-frame.html"
.parse()
.unwrap(),
),
)
.initialization_script(LINK_SCRIPT)
.user_agent("ModrinthApp Ads Webview")
.zoom_hotkeys_enabled(false)
.transparent(true),
LogicalPosition::new(x, y),
LogicalSize::new(width, height),
);
}
}

Expand Down

0 comments on commit ae38853

Please sign in to comment.