FIX: Add a popupId to store state (#186)

The dismissed state will be stored in local storage because popupId is
present now.
This commit is contained in:
Bianca Nenciu 2022-01-19 16:20:16 +02:00 committed by GitHub
parent a5b36dc344
commit 833070e2a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -1,5 +1,5 @@
{{#if show}}
{{#topic-navigation-popup}}
{{#topic-navigation-popup popupId="solved-notice" dismissDuration=oneWeek}}
<h3>{{i18n "solved.no_answer.title"}}</h3>
<p>{{i18n "solved.no_answer.description"}}</p>
{{/topic-navigation-popup}}

View File

@ -1,11 +1,15 @@
import { later } from "@ember/runloop";
// 7 days in milliseconds
const MAX_DURATION_WITH_NO_ANSWER = 7 * 24 * 60 * 60 * 1000;
const ONE_WEEK = 7 * 24 * 60 * 60 * 1000; // milliseconds
const MAX_DURATION_WITH_NO_ANSWER = ONE_WEEK;
export default {
setupComponent(args, component) {
component.set("show", false);
component.setProperties({
oneWeek: ONE_WEEK,
show: false,
});
later(() => {
if (