diff --git a/src/peertube-api.ts b/src/peertube-api.ts index 5515759..2f353a4 100644 --- a/src/peertube-api.ts +++ b/src/peertube-api.ts @@ -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}`;