1
0
mirror of https://gitlab.com/Cha_deL/peertubeify synced 2024-12-21 20:34:23 +01:00

Use Preferences abstraction instead of manual localStorage interaction

Default values and localStorage manipulation should be implemented in the
Prefereces class.
This commit is contained in:
Ealhad 2018-11-15 00:38:41 +01:00
parent 8049d4671e
commit 25b6e7949a

View File

@ -16,9 +16,10 @@
import * as _ from 'lodash/fp';
import constants from './constants';
import Preferences from './preferences';
async function fetchAPI(path: string, query?: Object) {
const instance = _.getOr(constants.peertubeAPI.defaultInstance, 'searchInstance', await browser.storage.local.get()).toString();
const instance = (await Preferences.getPreferences()).searchInstance;
let url = `https://${instance}/${constants.peertubeAPI.endpoint}/${path}`;