Skip to content

Commit f2a8006

Browse files
arturovtAndrewKushnir
authored andcommitted
refactor(core): replace PLATFORM_ID in initTransferState (angular#60299)
Replaces `PLATFORM_ID` check with the `ngServerMode`. PR Close angular#60299
1 parent ff772d7 commit f2a8006

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/core/src/transfer_state.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.dev/license
77
*/
88

9-
import {APP_ID, PLATFORM_ID} from './application/application_tokens';
9+
import {APP_ID} from './application/application_tokens';
1010
import {inject} from './di/injector_compatibility';
1111
import {ɵɵdefineInjectable} from './di/interface/defs';
1212
import {getDocument} from './render3/interfaces/document';
@@ -50,7 +50,7 @@ export function makeStateKey<T = void>(key: string): StateKey<T> {
5050

5151
function initTransferState(): TransferState {
5252
const transferState = new TransferState();
53-
if (inject(PLATFORM_ID) === 'browser') {
53+
if (typeof ngServerMode === 'undefined' || !ngServerMode) {
5454
transferState.store = retrieveTransferredState(getDocument(), inject(APP_ID));
5555
}
5656

0 commit comments

Comments
 (0)