Skip to content

Commit

Permalink
Merge pull request #1225 from Infomaniak/sort-files
Browse files Browse the repository at this point in the history
fix: Keep sortedName as lowercased
  • Loading branch information
Ambrdctr authored Jul 12, 2024
2 parents c76bb62 + 0c56a01 commit d3c33b8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kDriveCore/Data/Models/File.swift
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,10 @@ public final class File: Object, Codable {
uid = File.uid(driveId: driveId, fileId: id)
let decodedName = try container.decode(String.self, forKey: .name)
name = decodedName
sortedName = try container.decodeIfPresent(String.self, forKey: .sortedName) ?? decodedName
sortedName = try (container.decodeIfPresent(String.self, forKey: .sortedName) ?? decodedName).lowercased().folding(
options: .diacriticInsensitive,
locale: .current
)
path = try container.decodeIfPresent(String.self, forKey: .path)
rawType = try container.decode(String.self, forKey: .rawType)
rawStatus = try container.decodeIfPresent(String.self, forKey: .rawStatus)
Expand Down

0 comments on commit d3c33b8

Please sign in to comment.