mirror of
https://github.com/pezkuwichain/pezkuwi-ui.git
synced 2026-07-23 13:05:42 +00:00
Bump deps (#316)
* Bump deps * Remove unused deps * Bump berry * Bump berry
This commit is contained in:
@@ -9,12 +9,12 @@
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.9.2",
|
||||
"eventemitter3": "^4.0.0",
|
||||
"@babel/runtime": "^7.9.6",
|
||||
"eventemitter3": "^4.0.1",
|
||||
"store": "^2.0.12"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/util": "^2.9.1",
|
||||
"@polkadot/util": "^2.10.0-beta.3",
|
||||
"@types/store": "^2.0.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
||||
@@ -12,6 +12,14 @@ import { Option, SettingsStruct } from './types';
|
||||
type ChangeCallback = (settings: SettingsStruct) => void;
|
||||
type OnTypes = 'change';
|
||||
|
||||
function withDefault (options: Option[], option: string | undefined, fallback: string): string {
|
||||
const _option = option || fallback;
|
||||
|
||||
return options.some(({ value }) => value === _option)
|
||||
? _option
|
||||
: fallback;
|
||||
}
|
||||
|
||||
export class Settings implements SettingsStruct {
|
||||
readonly #emitter: EventEmitter;
|
||||
|
||||
@@ -39,8 +47,8 @@ export class Settings implements SettingsStruct {
|
||||
this.#emitter = new EventEmitter();
|
||||
|
||||
this.#apiUrl = (typeof settings.apiUrl === 'string' && settings.apiUrl) || process.env.WS_URL || ENDPOINT_DEFAULT;
|
||||
this.#camera = settings.camera || CAMERA_DEFAULT;
|
||||
this.#ledgerConn = settings.ledgerConn || LEDGER_CONN_DEFAULT;
|
||||
this.#camera = withDefault(CAMERA, settings.camera, CAMERA_DEFAULT);
|
||||
this.#ledgerConn = withDefault(LEDGER_CONN, settings.ledgerConn, LEDGER_CONN_DEFAULT);
|
||||
this.#i18nLang = settings.i18nLang || LANGUAGE_DEFAULT;
|
||||
this.#icon = settings.icon || ICON_DEFAULT;
|
||||
this.#locking = settings.locking || LOCKING_DEFAULT;
|
||||
|
||||
@@ -12,11 +12,12 @@ export const LEDGER_CONN: Option[] = [
|
||||
text: 'Do not attach Ledger devices',
|
||||
value: 'none'
|
||||
},
|
||||
{
|
||||
info: 'u2f',
|
||||
text: 'Attach Ledger via U2F',
|
||||
value: 'u2f'
|
||||
},
|
||||
// Deprecated
|
||||
// {
|
||||
// info: 'u2f',
|
||||
// text: 'Attach Ledger via U2F',
|
||||
// value: 'u2f'
|
||||
// },
|
||||
{
|
||||
info: 'webusb',
|
||||
text: 'Attach Ledger via WebUSB',
|
||||
|
||||
Reference in New Issue
Block a user