 ###
 
 
-TermsAnnouncementDirective = (TermsAnnouncementService, $repo, $auth, $config) ->
+TermsAnnouncementDirective = (TermsAnnouncementService, $repo, $auth, $config, $model) ->
     link = (scope, el, attrs) ->
         scope.privacyPolicyUrl = $config.get("privacyPolicyUrl")
         scope.termsOfServiceUrl = $config.get("termsOfServiceUrl")

    "tgTermsAnnouncementService",
    "$tgRepo",
    "$tgAuth",
    "$tgConfig"
]

angular.module("taigaComponents")

                TermsAnnouncementService.open = false
                user = $auth.getUser()

                # We need to force initialization of rootscope user if localstorage user
                # doesn't have the 'read_new_terms' key
                if user.read_new_terms == undefined
                    userData = user.getAttrs()
                    userData.read_new_terms = false
                    user = $model.make_model("users", userData)

                user.read_new_terms = true

                onSuccess = (data) ->
                    $auth.setUser(data)

                $repo.save(user).then(onSuccess)

            Object.defineProperties(this, {
