MCPcopy
hub / github.com/angular/angular / activateUpdate

Method activateUpdate

packages/service-worker/src/update.ts:125–136  ·  view source on GitHub ↗

* Updates the current client (i.e. browser tab) to the latest version that is ready for * activation. * * In most cases, you should not use this method and instead should update a client by reloading * the page. * * * * Updating a

()

Source from the content-addressed store, hash-verified

123 * - rejects if any error occurs
124 */
125 activateUpdate(): Promise<boolean> {
126 if (!this.sw.isEnabled) {
127 return Promise.reject(
128 new RuntimeError(
129 RuntimeErrorCode.SERVICE_WORKER_DISABLED_OR_NOT_SUPPORTED_BY_THIS_BROWSER,
130 (typeof ngDevMode === 'undefined' || ngDevMode) && ERR_SW_NOT_SUPPORTED,
131 ),
132 );
133 }
134 const nonce = this.sw.generateNonce();
135 return this.sw.postMessageWithOperation('ACTIVATE_UPDATE', {nonce}, nonce);
136 }
137}

Callers 1

comm_spec.tsFile · 0.80

Calls 3

generateNonceMethod · 0.80
rejectMethod · 0.45

Tested by

no test coverage detected