Files
pezkuwi-ui/packages/ui-settings
Arjun Porwal 421ccb322a Upgrade polkadot deps (#836)
* chore: upgrade deps

* fix: correct capitalization of "Overview" in README

* fix: correct capitalization of "overview" in README

* fix: update typescript version in package.json and yarn.lock

* fix: downgrade typescript version to 5.5.4
2025-06-18 17:57:21 +05:30
..
2025-05-23 15:27:16 +00:00
2025-06-18 17:57:21 +05:30
2019-02-27 11:18:35 +01:00

@polkadot/ui-settings

Manages app settings including endpoints, themes and prefixes

Usage Examples

User preferences are set as a settings object in the browser's local storage.

import settings from '@polkadot/ui-settings';

render () {
  // get api endpoint for the selected chain
  const WS_URL = settings.apiUrl();

  // get the selected il8n language
  const language = settings.il8nLang();

  // get all available il8n languages
  const languages = settings.availableLanguages();

  // update settings
  const updatedSettings = {
    ...settings,
    i18nLang: 'Arabic'
  }
  settings.set(updatedSettings);

  // NOTE: API currently does not handle hot reconnecting properly,
  so you need to manually reload the page after updating settings.
  window.location.reload();
}

Used by

Apps that currently use the settings package