Skip to content

Commit ea551e1

Browse files
committed
Code Quality: Fixed crash when creating an archive
1 parent 5b77618 commit ea551e1

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Diff for: src/Files.App/Data/Models/ByteSize.cs

+2-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ namespace Files.App.Data.Models
77
{
88
public struct ByteSize : IEquatable<ByteSize>, IComparable<ByteSize>
99
{
10-
private static IFoldersSettingsService FoldersSettingsService { get; } = Ioc.Default.GetRequiredService<IFoldersSettingsService>();
1110

1211
private static readonly FrozenDictionary<string, string> units = new Dictionary<string, string>
1312
{
@@ -29,9 +28,8 @@ public struct ByteSize : IEquatable<ByteSize>, IComparable<ByteSize>
2928
public ulong Bytes
3029
=> (ulong)size.Bytes;
3130

32-
public string ShortString => FoldersSettingsService.SizeUnitFormat == SizeUnitTypes.BinaryUnits
33-
? $"{size.LargestWholeNumberBinaryValue:0.##} {units[size.LargestWholeNumberBinarySymbol]}"
34-
: $"{size.LargestWholeNumberDecimalValue:0.##} {units[size.LargestWholeNumberDecimalSymbol]}";
31+
public string ShortString
32+
=> $"{size.LargestWholeNumberBinaryValue:0.##} {units[size.LargestWholeNumberBinarySymbol]}";
3533

3634
public string LongString
3735
=> $"{ShortString} ({size.Bytes:#,##0} {units[ByteSizeLib.ByteSize.ByteSymbol]})";

0 commit comments

Comments
 (0)