-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from podlove/feat/onboarding-settings
feat(setting) - set contributor/transcript module on if needed
- Loading branch information
Showing
8 changed files
with
79 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { select } from 'redux-saga/effects'; | ||
import * as request from '../../lib/request'; | ||
import { selectors } from '../../store'; | ||
import { type State as EpisodeState } from '../../store/episode.store'; | ||
|
||
export function* setOnboardingPodcastSettings() { | ||
const episodes : EpisodeState = yield select(selectors.episodes.list); | ||
if (!episodes || episodes.length === 0) { | ||
yield request.post(request.origin('/api/v1/set_podcast_settings'), { params: {}, data: {} }); | ||
} | ||
|
||
const hasContributor = episodes.some( | ||
(episode) => episode.data.contributors && episode.data.contributors.length > 0 | ||
); | ||
const hasTranscript = episodes.some( | ||
(episode) => episode.data.transcript && episode.data.transcript.url && episode.data.transcript.url.length > 0 | ||
); | ||
|
||
const module = { | ||
transcript: hasTranscript, | ||
contributor: hasContributor | ||
}; | ||
yield request.post(request.origin('/api/v1/set_podcast_settings'), { params: {}, data: module }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters