diff --git a/app/preprints/discover/route.ts b/app/preprints/discover/route.ts index 09ff0225c5f..ff32962c088 100644 --- a/app/preprints/discover/route.ts +++ b/app/preprints/discover/route.ts @@ -3,13 +3,17 @@ import Route from '@ember/routing/route'; import RouterService from '@ember/routing/router-service'; import { inject as service } from '@ember/service'; import config from 'ember-osf-web/config/environment'; +import PreprintProviderModel from 'ember-osf-web/models/preprint-provider'; +import MetaTags, { HeadTagDef } from 'ember-osf-web/services/meta-tags'; import Theme from 'ember-osf-web/services/theme'; export default class PreprintDiscoverRoute extends Route { @service store!: Store; @service theme!: Theme; @service router!: RouterService; + @service metaTags!: MetaTags; + headTags?: HeadTagDef[]; buildRouteInfoMetadata() { return { @@ -36,6 +40,20 @@ export default class PreprintDiscoverRoute extends Route { } } + // TODO: Move this to app/preprints/index/route.ts when landing page PR is merged + afterModel(model: PreprintProviderModel) { + if (model && model.assets && model.assets.favicon) { + const headTags = [{ + type: 'link', + attrs: { + rel: 'icon', + href: model.assets.favicon, + }, + }]; + this.set('headTags', headTags); + } + } + deactivate() { this.theme.reset(); }