Socket
Socket
Sign inDemoInstall

@polkadot/ui-settings

Package Overview
Dependencies
13
Maintainers
2
Versions
677
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @polkadot/ui-settings

Manages app settings


Version published
Weekly downloads
13K
decreased by-6.6%
Maintainers
2
Created
Weekly downloads
 

Changelog

Source

3.4.2 Jun 5, 2023

  • Bump to @polkadot/util 12.2.2

Readme

Source

@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

  • polkadot-js/apps
  • paritytech/substrate-light-ui

FAQs

Last updated on 05 Jun 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc