pleroma/app/soapbox/features/ads/providers/soapbox-config.ts

15 lines
387 B
TypeScript
Raw Normal View History

2022-08-01 16:50:46 -07:00
import { getSoapboxConfig } from 'soapbox/actions/soapbox';
import type { AdProvider } from '.';
/** Provides ads from Soapbox Config. */
const SoapboxConfigAdProvider: AdProvider = {
getAds: async(getState) => {
const state = getState();
const soapboxConfig = getSoapboxConfig(state);
return soapboxConfig.ads.toArray();
},
};
export default SoapboxConfigAdProvider;