Skip to content

Commit

Permalink
Merge branch 'whitespace-should-be-trimmed-from-list-names-when-saved…
Browse files Browse the repository at this point in the history
…-ios-656'
  • Loading branch information
buggmagnet committed May 6, 2024
2 parents 82b1aeb + f9ecbc4 commit c2f6334
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ios/MullvadSettings/CustomListRepository.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public struct CustomListRepository: CustomListRepositoryProtocol {
public init() {}

public func save(list: CustomList) throws {
var list = list
list.name = list.name.trimmingCharacters(in: .whitespaces)

var lists = fetchAll()

if let listWithSameName = lists.first(where: { $0.name.compare(list.name) == .orderedSame }),
Expand Down

0 comments on commit c2f6334

Please sign in to comment.