Fix copy status 0 division
This commit is contained in:
@@ -45,7 +45,11 @@ public class CopyCommand : CommandBase, ITransportationCommand
|
|||||||
.Select(p =>
|
.Select(p =>
|
||||||
{
|
{
|
||||||
if (p is null) return Observable.Never<int>();
|
if (p is null) return Observable.Never<int>();
|
||||||
return p.Progress.Select(currentProgress => (int) (currentProgress * 100 / p.TotalCount));
|
return p.Progress.Select(currentProgress =>
|
||||||
|
p.TotalCount == 0
|
||||||
|
? 0
|
||||||
|
: (int) (currentProgress * 100 / p.TotalCount)
|
||||||
|
);
|
||||||
})
|
})
|
||||||
.Switch()
|
.Switch()
|
||||||
.Subscribe(SetCurrentProgress);
|
.Subscribe(SetCurrentProgress);
|
||||||
|
|||||||
Reference in New Issue
Block a user