Fix condition for creating Redux tasks.

Remove erroneous outer `if` condition which would generally fail to be met, except in the case we'd not want to enter the code block. I also took the opportunity to move the termination condition into the `while`, which simplifies things a lot.