MCPcopy
hub / github.com/mayswind/AriaNg / getOptions

Function getOptions

src/scripts/services/ariaNgSettingService.js:150–180  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

148 };
149
150 var getOptions = function () {
151 var options = ariaNgStorageService.get(ariaNgConstants.optionStorageKey);
152
153 if (options && !ariaNgLanguages[options.language]) {
154 options.language = getLanguageNameFromAliasOrDefaultLanguage(options.language);
155 }
156
157 if (!options) {
158 options = angular.extend({}, ariaNgDefaultOptions);
159 options.language = getDefaultLanguage();
160
161 if (!options.rpcHost) {
162 initRpcSettingWithDefaultHostAndProtocol(options);
163 }
164
165 if (angular.isArray(options.extendRpcServers)) {
166 for (var i = 0; i < options.extendRpcServers.length; i++) {
167 var rpcSetting = options.extendRpcServers[i];
168
169 if (!rpcSetting.rpcHost) {
170 initRpcSettingWithDefaultHostAndProtocol(rpcSetting);
171 }
172 }
173 }
174
175 setOptions(options);
176 fireFirstVisitEvent();
177 }
178
179 return options;
180 };
181
182 var clearAll = function () {
183 return ariaNgStorageService.clearAll();

Callers 3

getOptionFunction · 0.85
setOptionFunction · 0.85

Calls 5

getDefaultLanguageFunction · 0.85
fireFirstVisitEventFunction · 0.85
setOptionsFunction · 0.70

Tested by

no test coverage detected