Skip to content

Commit

Permalink
fix: improve performance of sidepanel
Browse files Browse the repository at this point in the history
  • Loading branch information
Zomatree committed Oct 15, 2024
1 parent e6ee3e4 commit 8b0975b
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions Revolt/Pages/Home/Home.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ struct HomeRewritten: View {
@State var calculatedSize = CGFloat.zero

func toggleSidebar() {
print(offset, calculatedSize)
withAnimation {
if offset != .zero {
offset = .zero
Expand Down Expand Up @@ -130,13 +129,13 @@ struct HomeRewritten: View {
.simultaneousGesture(
DragGesture(minimumDistance: 50.0)
.onChanged({ g in
withAnimation {
if offset > snapSide {
forceOpen = true
} else if offset <= snapSide {
forceOpen = false
}
if offset > snapSide {
forceOpen = true
} else if offset <= snapSide {
forceOpen = false
}

withAnimation {
offset = min(max(g.translation.width, 0), sidebarWidth)
}
})
Expand Down

0 comments on commit 8b0975b

Please sign in to comment.