Refactor: Only add the completed line when completed is greater than zero but less than total.
This commit is contained in:
parent
5579b76173
commit
6fbc5b6c20
1 changed files with 5 additions and 2 deletions
|
@ -130,7 +130,8 @@ class _main extends State<MainGen> {
|
|||
var pokemon = Pokemon.values[iterNumber];
|
||||
|
||||
if (currentGen != pokemon.generation) {
|
||||
if (total > 0) sb.append("\n- Completed $completed/$total\n");
|
||||
if (total > 0 && completed != total && completed > 0)
|
||||
sb.append("\n- Completed $completed/$total\n");
|
||||
|
||||
sb.append("\n# Generation ${pokemon.generation.name}\n\n");
|
||||
currentGen = pokemon.generation;
|
||||
|
@ -187,7 +188,9 @@ class _main extends State<MainGen> {
|
|||
setState(() {});
|
||||
} else if (state - index == 6) {
|
||||
// Task - write file
|
||||
sb.append("\n- Completed $completed/$total\n");
|
||||
|
||||
if (completed != total && completed > 0)
|
||||
sb.append("\n- Completed $completed/$total\n");
|
||||
|
||||
maxTasks += 3;
|
||||
statusMessage = "Saving to COMPLETED.md";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue