MCPcopy Create free account
hub / github.com/ICBNetwork/web3-Wallet / onPreferencesStateChange

Method onPreferencesStateChange

app/core/Engine.ts:386–395  ·  view source on GitHub ↗
(
      // preferencesState is typed as any because if not will give an ts error on every assets-controllers using this function
      // because assets-controllers preferences controller version is misaligned with the app repo (v8 != v4)
      // and because of that preferencesState would be two different objects
      listener: (preferencesState: PreferencesState) => void,
    )

Source from the content-addressed store, hash-verified

384 * @param listener - The callback function to execute when the state changes.
385 */
386 const onPreferencesStateChange = (
387 // preferencesState is typed as any because if not will give an ts error on every assets-controllers using this function
388 // because assets-controllers preferences controller version is misaligned with the app repo (v8 != v4)
389 // and because of that preferencesState would be two different objects
390 listener: (preferencesState: PreferencesState) => void,
391 ) => {
392 const eventName = `PreferencesController:stateChange`;
393
394 this.controllerMessenger.subscribe(eventName, listener);
395 };
396
397 const approvalController = new ApprovalController({
398 // @ts-expect-error TODO: Resolve/patch mismatch between base-controller versions. Before: never, never. Now: string, string, which expects 3rd and 4th args to be informed for restrictedControllerMessengers

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected