mirror of
https://github.com/carey314/mio-plugin-fund.git
synced 2026-08-10 05:44:31 +00:00
fix(toast): correct sleep duration — 2.0s → 2.6s
UInt64(durationSeconds) truncated the Double 2.6 to 2 before multiplying by 1e9 ns, so toasts vanished 0.6s early. Move the multiplication inside the cast. Caught in 2026-05-19 code review, swift-verified. Bump CFBundleVersion 3 → 4. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
63c7c0bc60
commit
a4a747bc77
@ -17,7 +17,7 @@
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.3.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>3</string>
|
||||
<string>4</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>FundPlugin.FundPlugin</string>
|
||||
<!--
|
||||
|
||||
@ -61,7 +61,12 @@ final class ToastController: ObservableObject {
|
||||
toasts.append(item)
|
||||
}
|
||||
Task { [weak self] in
|
||||
try? await Task.sleep(nanoseconds: UInt64(self?.durationSeconds ?? 2.6) * 1_000_000_000)
|
||||
// BUG fix (2026-05-19 review): `UInt64(2.6)` truncates to 2,
|
||||
// so the previous `UInt64(dur) * 1_000_000_000` slept 2.0s
|
||||
// instead of 2.6s — every toast vanished 0.6s early. Do the
|
||||
// multiply first, then cast.
|
||||
let dur = self?.durationSeconds ?? 2.6
|
||||
try? await Task.sleep(nanoseconds: UInt64(dur * 1_000_000_000))
|
||||
await MainActor.run { [weak self] in
|
||||
self?.dismiss(item.id)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user