Merge pull request #1202 from siiky/docs/lam-434/tc

docs: update the T&C resolver comment
This commit is contained in:
Rafael Taranto 2022-05-02 10:45:48 +01:00 committed by GitHub
commit e4cf1d6297

View file

@ -240,9 +240,18 @@ const massageTerms = terms => (terms.active && terms.text) ? ({
* Just (Just hash, Nothing) => Nothing * Just (Just hash, Nothing) => Nothing
* May happen (after `massageTerms`) if T&C are disabled. * May happen (after `massageTerms`) if T&C are disabled.
* *
* Just (Just hash, Just tc) => Just (hash, Just tc) or Just (hash, Nothing) * Just (Just hash, Just tc) => Just (hash, Nothing, Nothing)
* `tc` is sent depending on whether the `hash` differs from `currentHash` or * If both the `hash` and the `configVersion` are the same as `currentHash`
* not. * and `currentConfigVersion`, respectively, then there's no need to send
* `text` nor `details`.
*
* Just (Just hash, Just tc) => Just (hash, Nothing, Just details)
* If `configVersion` differs from `currentConfigVersion` but the `hash` is
* the same, then only the details have to be updated.
*
* Just (Just hash, Just tc) => Just (hash, Just text, Just details)
* If the `hash` differs from `currentHash` then everything is resent (to
* simplify machine implementation).
*/ */
const terms = (parent, { currentConfigVersion, currentHash }, { deviceId, settings }, info) => { const terms = (parent, { currentConfigVersion, currentHash }, { deviceId, settings }, info) => {
const isNone = x => _.isNil(x) || _.isEmpty(x) const isNone = x => _.isNil(x) || _.isEmpty(x)