Skip to content

Commit 4eca1c4

Browse files
committed
Fixed SwiftLint and PR issues
1 parent be8c4a7 commit 4eca1c4

2 files changed

Lines changed: 3 additions & 18 deletions

File tree

CodeEdit/Features/Notifications/ViewModels/NotificationOverlayViewModel.swift

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,6 @@ final class NotificationOverlayViewModel: ObservableObject {
2828

2929
private var notificationManager = NotificationManager.shared
3030

31-
/// Whether any non-sticky notifications are currently hidden
32-
private var hasHiddenNotifications: Bool {
33-
activeNotifications.contains { notification in
34-
!notification.isSticky && !isNotificationVisible(notification)
35-
}
36-
}
37-
3831
@Published var scrolledToTop: Bool = true
3932

4033
/// Whether a notification should be visible in the overlay

CodeEdit/Features/Notifications/Views/NotificationOverlayView.swift

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ struct NotificationOverlayView: View {
2323

2424
@State private var hasOverflow: Bool = false
2525
@State private var contentHeight: CGFloat = 0.0
26-
@State private var scrollOffset: CGFloat = 0
2726

2827
private func updateOverflow(contentHeight: CGFloat, containerHeight: CGFloat) {
2928
if !hasOverflow && contentHeight > containerHeight {
@@ -33,12 +32,12 @@ struct NotificationOverlayView: View {
3332
}
3433
}
3534

36-
var notifications: some View {
35+
@ViewBuilder var notifications: some View {
3736
let visibleNotifications = workspace.notificationOverlay.activeNotifications.filter {
3837
workspace.notificationOverlay.isNotificationVisible($0)
3938
}
4039

41-
return VStack(spacing: 8) {
40+
VStack(spacing: 8) {
4241
ForEach(visibleNotifications, id: \.id) { notification in
4342
NotificationBannerView(
4443
notification: notification,
@@ -59,7 +58,7 @@ struct NotificationOverlayView: View {
5958
.animation(.easeInOut(duration: 0.3), value: visibleNotifications)
6059
}
6160

62-
var notificationsWithScrollView: some View {
61+
@ViewBuilder var notificationsWithScrollView: some View {
6362
GeometryReader { geometry in
6463
HStack {
6564
Spacer()
@@ -161,10 +160,3 @@ struct NotificationOverlayView: View {
161160
.animation(.easeInOut(duration: 0.2), value: controlActiveState)
162161
}
163162
}
164-
165-
struct ScrollOffsetPreferenceKey: PreferenceKey {
166-
static var defaultValue: CGFloat = 0
167-
static func reduce(value: inout CGFloat, nextValue: () -> CGFloat) {
168-
value = nextValue()
169-
}
170-
}

0 commit comments

Comments
 (0)