LGTM, thought this was gonna need to be async, but apparently it works.

(this runs the promise's then() only if totalsPromise is initialized)