I'm not sure this works because I'm not sure the first then function will be called synchronously by the render frame invoking resolve.