{"size": 731, "ext": "es6", "max_stars_repo_path": "app/assets/javascripts/discourse/components/signup-cta.js.es6", "max_stars_repo_name": "threefoldtech/threefold-forums", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "app/assets/javascripts/discourse/components/signup-cta.js.es6", "max_issues_repo_name": "threefoldtech/threefold-forums", "max_issues_repo_issues_event_min_datetime": "2020-04-02T10:09:47.000Z", "max_issues_repo_issues_event_max_datetime": "2021-07-05T12:59:51.000Z", "max_forks_repo_path": "app/assets/javascripts/discourse/components/signup-cta.js.es6", "max_forks_repo_name": "threefoldtech/threefold-forums", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 5, "max_forks_count": null, "avg_line_length": 28.1153846154, "max_line_length": 74, "alphanum_fraction": 0.6429548564}
import { later } from "@ember/runloop";
import Component from "@ember/component";
import { on } from "@ember/object/evented";

export default Component.extend({
  action: "showCreateAccount",

  actions: {
    neverShow() {
      this.keyValueStore.setItem("anon-cta-never", "t");
      this.session.set("showSignupCta", false);
    },
    hideForSession() {
      this.session.set("hideSignupCta", true);
      this.keyValueStore.setItem("anon-cta-hidden", new Date().getTime());
      later(() => this.session.set("showSignupCta", false), 20 * 1000);
    }
  },

  _turnOffIfHidden: on("willDestroyElement", function() {
    if (this.session.get("hideSignupCta")) {
      this.session.set("showSignupCta", false);
    }
  })
});
