Convert getDefaultOptions to a utility function (#1235)
This commit is contained in:
parent
c1e4741f22
commit
39741bf1d2
@ -17,6 +17,7 @@
|
||||
|
||||
/* global
|
||||
* HtmlTemplateCollection
|
||||
* OptionsUtil
|
||||
* api
|
||||
*/
|
||||
|
||||
@ -124,6 +125,13 @@ class SettingsController extends EventDispatcher {
|
||||
return this._templates.instantiateFragment(name);
|
||||
}
|
||||
|
||||
async getDefaultOptions() {
|
||||
const optionsUtil = new OptionsUtil();
|
||||
await optionsUtil.prepare();
|
||||
const optionsFull = optionsUtil.getDefault();
|
||||
return optionsFull;
|
||||
}
|
||||
|
||||
// Private
|
||||
|
||||
_setProfileIndex(value) {
|
||||
|
@ -15,10 +15,6 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* global
|
||||
* OptionsUtil
|
||||
*/
|
||||
|
||||
class SentenceTerminationCharactersController {
|
||||
constructor(settingsController) {
|
||||
this._settingsController = settingsController;
|
||||
@ -135,18 +131,11 @@ class SentenceTerminationCharactersController {
|
||||
}
|
||||
|
||||
async _reset() {
|
||||
const defaultOptions = await this._getDefaultOptions();
|
||||
const defaultOptions = await this._settingsController.getDefaultOptions();
|
||||
const value = defaultOptions.profiles[0].options.sentenceParsing.terminationCharacters;
|
||||
await this._settingsController.setProfileSetting('sentenceParsing.terminationCharacters', value);
|
||||
await this._updateOptions();
|
||||
}
|
||||
|
||||
async _getDefaultOptions() {
|
||||
const optionsUtil = new OptionsUtil();
|
||||
await optionsUtil.prepare();
|
||||
const optionsFull = optionsUtil.getDefault();
|
||||
return optionsFull;
|
||||
}
|
||||
}
|
||||
|
||||
class SentenceTerminationCharacterEntry {
|
||||
|
Loading…
Reference in New Issue
Block a user