Skip to content

Commit c33f277

Browse files
committed
ui: 캐시 디렉토리가 비어 있으면 버튼 탭을 막고 비활성화 형태로 개선
1 parent bc02512 commit c33f277

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

DevLog/UI/Setting/SettingView.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,19 @@ struct SettingView: View {
3535
.foregroundStyle(Color.primary)
3636
}
3737

38+
let dirSize = viewModel.state.dirSize
3839
Button {
3940
viewModel.send(.tapRemoveCacheButton)
4041
} label: {
4142
HStack {
4243
Text("임시 데이터 삭제")
43-
.foregroundStyle(Color.primary)
44+
.foregroundStyle(dirSize == 0 ? Color.secondary : .primary)
4445
Spacer()
45-
Text(formatFileSize(bytes: viewModel.state.dirSize))
46-
.foregroundStyle(Color.secondary)
46+
Text(formatFileSize(bytes: dirSize))
47+
.foregroundStyle(Color.secondary.opacity(dirSize == 0 ? 0 : 1))
4748
}
4849
}
50+
.disabled(dirSize == 0)
4951
}
5052

5153
Section {

0 commit comments

Comments
 (0)