the condition was wrong :)

if (currentPage || (!currentPage && numberOfSpecialPages === 1))