mirror of
https://github.com/pezkuwichain/pezkuwi-ui.git
synced 2026-05-30 02:21:06 +00:00
Add prefixes to settings (#158)
This commit is contained in:
@@ -3,8 +3,9 @@
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import store from 'store';
|
||||
import { isUndefined } from '@polkadot/util';
|
||||
|
||||
import { CRYPTOS, ENDPOINT_DEFAULT, ENDPOINTS, LANGUAGE_DEFAULT, LANGUAGES, LOCKING_DEFAULT, LOCKING, UIMODE_DEFAULT, UIMODES, UITHEME_DEFAULT, UITHEMES } from './defaults';
|
||||
import { CRYPTOS, ENDPOINT_DEFAULT, ENDPOINTS, LANGUAGE_DEFAULT, LANGUAGES, LOCKING_DEFAULT, LOCKING, UIMODE_DEFAULT, UIMODES, UITHEME_DEFAULT, UITHEMES, PREFIX_DEFAULT } from './defaults';
|
||||
import { Options, SettingsStruct } from './types';
|
||||
|
||||
export class Settings implements SettingsStruct {
|
||||
@@ -14,6 +15,8 @@ export class Settings implements SettingsStruct {
|
||||
|
||||
private _locking: string;
|
||||
|
||||
private _prefix: number;
|
||||
|
||||
private _uiMode: string;
|
||||
|
||||
private _uiTheme: string;
|
||||
@@ -24,6 +27,7 @@ export class Settings implements SettingsStruct {
|
||||
this._apiUrl = settings.apiUrl || process.env.WS_URL || ENDPOINT_DEFAULT;
|
||||
this._i18nLang = settings.i18nLang || LANGUAGE_DEFAULT;
|
||||
this._locking = settings.locking || LOCKING_DEFAULT;
|
||||
this._prefix = isUndefined(settings.prefix) ? PREFIX_DEFAULT : settings.prefix;
|
||||
this._uiMode = settings.uiMode || UIMODE_DEFAULT;
|
||||
this._uiTheme = settings.uiTheme || UITHEME_DEFAULT;
|
||||
}
|
||||
@@ -40,6 +44,10 @@ export class Settings implements SettingsStruct {
|
||||
return this._locking;
|
||||
}
|
||||
|
||||
public get prefix (): number {
|
||||
return this._prefix;
|
||||
}
|
||||
|
||||
public get uiMode (): string {
|
||||
return this._uiMode;
|
||||
}
|
||||
@@ -77,6 +85,7 @@ export class Settings implements SettingsStruct {
|
||||
apiUrl: this._apiUrl,
|
||||
i18nLang: this._i18nLang,
|
||||
locking: this._locking,
|
||||
prefix: this._prefix,
|
||||
uiMode: this._uiMode,
|
||||
uiTheme: this._uiTheme
|
||||
};
|
||||
@@ -86,6 +95,7 @@ export class Settings implements SettingsStruct {
|
||||
this._apiUrl = settings.apiUrl || this._apiUrl;
|
||||
this._i18nLang = settings.i18nLang || this._i18nLang;
|
||||
this._locking = settings.locking || this._locking;
|
||||
this._prefix = isUndefined(settings.prefix) ? this._prefix : settings.prefix;
|
||||
this._uiMode = settings.uiMode || this._uiMode;
|
||||
this._uiTheme = settings.uiTheme || this._uiTheme;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user