mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-20 18:57:17 +03:00
fix(app): go back and forward with the mouse buttons on desktop (#65129)
This commit is contained in:
committed by
GitHub
Unverified
parent
f0df6070f9
commit
13efefcfd3
@@ -201,6 +201,17 @@ export function Titlebar(props: { verticalTabs?: { mount?: HTMLElement } }) {
|
||||
},
|
||||
])
|
||||
|
||||
// The desktop router keeps its history in memory, so the mouse's Back and Forward buttons do nothing on their own.
|
||||
// The web app's browser already traverses its real history for them.
|
||||
if (platform.platform === "desktop")
|
||||
makeEventListener(window, "mouseup", (event) => {
|
||||
if (event.button !== 3 && event.button !== 4) return
|
||||
event.preventDefault()
|
||||
|
||||
if (event.button === 3) return history.back()
|
||||
history.forward()
|
||||
})
|
||||
|
||||
return (
|
||||
<header
|
||||
data-slot="titlebar-v2"
|
||||
|
||||
Reference in New Issue
Block a user