Socket
Socket
Sign inDemoInstall

@polkadot/ui-settings

Package Overview
Dependencies
14
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
14K
decreased by-6.4%
Maintainers
2
Install size
3.26 MB
Created
Weekly downloads
 

Changelog

Source

3.6.6 Apr 17, 2024

Contributed:

  • Add compatibility layer for H160 addresses (Thanks to https://github.com/vikiival)

Changes:

  • Update ci checkout and setup_node to v4
  • Bump yarn to 4.1.1

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 17 Apr 2024

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