No, you would only be charged capital gains on your total profit.
So, if you made $1,000 on the first sale and $3,000 on the second sale, you would only pay capital gains on the $4,000 total.
Make sure that the basis you are using for the second sale is the price you rebought it for and not the original price.