MCPcopy Create free account
hub / github.com/compiler-explorer/compiler-explorer / onStateChanged

Method onStateChanged

static/sharing.ts:103–112  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

101 }
102
103 protected onStateChanged(): void {
104 const config = SharingBase.filterComponentState(this.layout.toConfig());
105 this.ensureUrlIsNotOutdated(config);
106
107 // Update embedded links if present (works in both modes)
108 if (options.embedded) {
109 const strippedToLast = window.location.pathname.substring(0, window.location.pathname.lastIndexOf('/') + 1);
110 $('a.link').prop('href', strippedToLast + '#' + serialiseState(config));
111 }
112 }
113
114 protected ensureUrlIsNotOutdated(config: any): void {
115 const stringifiedConfig = JSON.stringify(config);

Callers

nothing calls this directly

Calls 3

serialiseStateFunction · 0.85
filterComponentStateMethod · 0.80

Tested by

no test coverage detected