Skip to content

Commit 48648a5

Browse files
committed
fix(perry-ui-gtk4): webview.rs follow-up — TimeSpan + mut action (v0.5.865)
v0.5.864 left 2 more errors in webview.rs surfaced once the build was re-enabled: 1. `WebsiteDataManager::clear` takes `glib::TimeSpan`, not `std::time::Duration`. Use `TimeSpan::from_seconds(0)` for "from epoch" semantics. 2. `action_decision.navigation_action()` returns a wrapper that needs `&mut self` for `.request()`. Bind as `mut`.
1 parent 64e3809 commit 48648a5

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
88

99
Perry is a native TypeScript compiler written in Rust that compiles TypeScript source code directly to native executables. It uses SWC for TypeScript parsing and LLVM for code generation.
1010

11-
**Current Version:** 0.5.862
11+
**Current Version:** 0.5.865
1212

1313

1414
## TypeScript Parity Status

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ opt-level = "s" # Optimize for size in stdlib
188188
opt-level = 3
189189

190190
[workspace.package]
191-
version = "0.5.862"
191+
version = "0.5.865"
192192
edition = "2021"
193193
license = "MIT"
194194
repository = "https://github.com/PerryTS/perry"

crates/perry-ui-gtk4/src/widgets/webview.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ fn install_signal_handlers(handle: i64, webview: &webkit6::WebView) {
144144
Some(d) => d,
145145
None => return false,
146146
};
147-
let action = match action_decision.navigation_action() {
147+
let mut action = match action_decision.navigation_action() {
148148
Some(a) => a,
149149
None => return false,
150150
};
@@ -320,9 +320,11 @@ pub fn clear_cookies(handle: i64) {
320320
// COOKIES bitflag + duration 0 = "all cookies since epoch".
321321
if let Some(dm) = session.website_data_manager() {
322322
let cancellable: Option<&gtk4::gio::Cancellable> = None;
323+
// glib::TimeSpan is microseconds. 0 = "from epoch" =
324+
// clear all cookies regardless of age.
323325
dm.clear(
324326
webkit6::WebsiteDataTypes::COOKIES,
325-
std::time::Duration::ZERO,
327+
gtk4::glib::TimeSpan::from_seconds(0),
326328
cancellable,
327329
|_| {},
328330
);

0 commit comments

Comments
 (0)