-
Notifications
You must be signed in to change notification settings - Fork 482
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 #26697 from code-dot-org/dtl_candidate_04d2a073
- Loading branch information
Showing
86 changed files
with
68,954 additions
and
235 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// A session variable storing a comma-delimited list of course/script names for which: | ||
// ...the user has already dismissed the version redirect warning. | ||
const DISMISSED_REDIRECT_WARNINGS_SESSION_KEY = 'dismissedRedirectWarnings'; | ||
// ...the user has already dismissed the version redirect dialog (<RedirectDialog/> component). | ||
const DISMISSED_REDIRECT_DIALOGS_SESSION_KEY = 'dismissedRedirectDialogs'; | ||
|
||
export const dismissedRedirect = (sessionKey, name) => { | ||
const dismissedRedirects = sessionStorage.getItem(sessionKey); | ||
return (dismissedRedirects || '').split(',').includes(name); | ||
}; | ||
|
||
export const dismissedRedirectWarning = (name) => { | ||
return dismissedRedirect(DISMISSED_REDIRECT_WARNINGS_SESSION_KEY, name); | ||
}; | ||
|
||
export const dismissedRedirectDialog = (name) => { | ||
return dismissedRedirect(DISMISSED_REDIRECT_DIALOGS_SESSION_KEY, name); | ||
}; | ||
|
||
export const onDismissRedirect = (sessionKey, name) => { | ||
let dismissedRedirects = sessionStorage.getItem(sessionKey); | ||
if (dismissedRedirects) { | ||
dismissedRedirects += `,${name}`; | ||
} else { | ||
dismissedRedirects = name; | ||
} | ||
sessionStorage.setItem(sessionKey, dismissedRedirects); | ||
}; | ||
|
||
export const onDismissRedirectWarning = (name) => { | ||
return onDismissRedirect(DISMISSED_REDIRECT_WARNINGS_SESSION_KEY, name); | ||
}; | ||
|
||
export const onDismissRedirectDialog = (name) => { | ||
return onDismissRedirect(DISMISSED_REDIRECT_DIALOGS_SESSION_KEY, name); | ||
}; |
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
Oops, something went wrong.