Skip to content

Commit deda164

Browse files
authored
[#338] HomeView의 최근 수정 섹션 내용이 반영되지 않는 문제를 해결한다 (#339)
* fix: 불필요한 == 연산자 구현으로 인해 수정되었을 시 뷰에서 반영이 안되는 현상 해결 * refacto: 엔티티 모델에 Hashable을 일괄 적용하여 프레젠테이션 모델에서 구현을 최소화 * style: 변수명 수정 * feat: 원본 이름과 색이 다를 때만 저장 버튼 활성화 조건 추가
1 parent d3517a4 commit deda164

14 files changed

Lines changed: 24 additions & 70 deletions

DevLog/Domain/Entity/PushNotification.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import Foundation
99

10-
struct PushNotification {
10+
struct PushNotification: Hashable {
1111
let id: String
1212
let title: String
1313
let body: String

DevLog/Domain/Entity/SystemTodoCategory.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import Foundation
99

10-
enum SystemTodoCategory: String, CaseIterable {
10+
enum SystemTodoCategory: String, CaseIterable, Hashable {
1111
case issue // 이슈
1212
case feature // 신규 기능
1313
case improvement // 개선/리팩터링

DevLog/Domain/Entity/Todo.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import Foundation
99

10-
struct Todo: Equatable {
10+
struct Todo: Hashable {
1111
let id: String
1212
var isPinned: Bool // 해당 할 일이 상단에 고정되어 있는지 여부
1313
var isCompleted: Bool // 해당 할 일의 완료 여부

DevLog/Domain/Entity/TodoCategory.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import Foundation
99

10-
enum TodoCategory: Equatable {
10+
enum TodoCategory: Hashable {
1111
case system(SystemTodoCategory)
1212
case user(UserTodoCategory)
1313

DevLog/Domain/Entity/TodoReference.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import Foundation
99

10-
struct TodoReference {
10+
struct TodoReference: Hashable {
1111
let id: String
1212
let title: String
1313
let category: TodoCategory

DevLog/Domain/Entity/UserTodoCategory.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import Foundation
99

10-
struct UserTodoCategory: Equatable {
10+
struct UserTodoCategory: Hashable {
1111
var id: String
1212
var name: String
1313
var colorHex: String

DevLog/Domain/Entity/WebPage.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import Foundation
99

10-
struct WebPage {
10+
struct WebPage: Hashable {
1111
let title: String?
1212
let url: URL
1313
let displayURL: URL

DevLog/Presentation/Structure/Profile/ProfileSelectedDayActivity.swift

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,4 @@ struct ProfileSelectedDayActivity: Identifiable, Hashable {
2020
}
2121
return showsCreated ? "생성" : "완료"
2222
}
23-
24-
static func == (lhs: Self, rhs: Self) -> Bool {
25-
lhs.todo.id == rhs.todo.id
26-
&& lhs.showsCreated == rhs.showsCreated
27-
&& lhs.showsCompleted == rhs.showsCompleted
28-
}
29-
30-
func hash(into hasher: inout Hasher) {
31-
hasher.combine(todo.id)
32-
hasher.combine(showsCreated)
33-
hasher.combine(showsCompleted)
34-
}
3523
}

DevLog/Presentation/Structure/PushNotificationItem.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,4 @@ struct PushNotificationItem: Identifiable, Hashable {
2525
self.todoId = notification.todoId
2626
self.todoCategory = notification.todoCategory
2727
}
28-
29-
static func == (lhs: PushNotificationItem, rhs: PushNotificationItem) -> Bool {
30-
lhs.id == rhs.id
31-
}
32-
33-
func hash(into hasher: inout Hasher) {
34-
hasher.combine(id)
35-
}
3628
}

DevLog/Presentation/Structure/RecentTodoItem.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,4 @@ struct RecentTodoItem: Identifiable, Hashable {
2525
self.tags = todo.tags
2626
self.category = todo.category
2727
}
28-
29-
static func == (lhs: RecentTodoItem, rhs: RecentTodoItem) -> Bool {
30-
lhs.id == rhs.id
31-
}
32-
33-
func hash(into hasher: inout Hasher) {
34-
hasher.combine(id)
35-
}
3628
}

0 commit comments

Comments
 (0)