2020-05-19 05:02:56 -04:00
|
|
|
import App from '../base'
|
2018-11-05 05:06:39 -05:00
|
|
|
|
2020-06-05 06:14:39 -04:00
|
|
|
App.controller('TranslationsPopupController', function(
|
2020-05-19 05:02:56 -04:00
|
|
|
$scope,
|
2020-06-05 06:14:39 -04:00
|
|
|
ipCookie,
|
|
|
|
localStorage
|
2020-05-19 05:02:56 -04:00
|
|
|
) {
|
2020-06-05 06:14:39 -04:00
|
|
|
function getStoredDismissal() {
|
|
|
|
let localStore = localStorage('hide-i18n-notification')
|
2020-05-19 05:02:56 -04:00
|
|
|
|
2020-06-05 06:14:39 -04:00
|
|
|
if (localStore === null) {
|
|
|
|
// Not stored in localStorage, check cookie
|
|
|
|
let cookieStore = ipCookie('hidei18nNotification')
|
|
|
|
|
|
|
|
// If stored in cookie, set on localStorage for forwards compat
|
|
|
|
if (cookieStore) {
|
|
|
|
localStorage('hide-i18n-notification', cookieStore)
|
|
|
|
ipCookie.remove('hidei18nNotification')
|
|
|
|
}
|
|
|
|
|
|
|
|
return cookieStore
|
|
|
|
}
|
|
|
|
|
|
|
|
return localStore
|
|
|
|
}
|
|
|
|
|
|
|
|
$scope.hidei18nNotification = getStoredDismissal()
|
|
|
|
|
|
|
|
$scope.dismiss = function() {
|
|
|
|
localStorage('hide-i18n-notification', true)
|
|
|
|
$scope.hidei18nNotification = true
|
|
|
|
}
|
2020-05-19 05:02:56 -04:00
|
|
|
})
|