Skip to content

Commit

Permalink
fix: serviceTypes count is greater than services count, cause crash
Browse files Browse the repository at this point in the history
  • Loading branch information
tisfeng committed Jan 8, 2024
1 parent 76cb6d9 commit ea8c9e0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Easydict/NewApp/View/SettingView/Tabs/ServiceTab.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ struct ServiceTab: View {

func loadService(type: Int) {
let windowType = EZWindowType(rawValue: type) ?? .none
serviceTypes = EZLocalStorage.shared().allServiceTypes(windowType)
services = EZLocalStorage.shared().allServices(windowType)
serviceTypes = services.map { service in
service.serviceType()
}
}

func serviceToggled(index: Int, isEnable: Bool) {
Expand Down

0 comments on commit ea8c9e0

Please sign in to comment.