feat: Implement logic to prevent deletion of system tasks and rewards; update APIs and tests accordingly
All checks were successful
Gitea Actions Demo / build-and-push (push) Successful in 34s
All checks were successful
Gitea Actions Demo / build-and-push (push) Successful in 34s
This commit is contained in:
@@ -1,12 +1,19 @@
|
||||
import { ref, watch } from 'vue'
|
||||
|
||||
export const isParentAuthenticated = ref(localStorage.getItem('isParentAuthenticated') === 'true')
|
||||
const hasLocalStorage =
|
||||
typeof localStorage !== 'undefined' && typeof localStorage.getItem === 'function'
|
||||
|
||||
export const isParentAuthenticated = ref(
|
||||
hasLocalStorage ? localStorage.getItem('isParentAuthenticated') === 'true' : false,
|
||||
)
|
||||
export const isUserLoggedIn = ref(false)
|
||||
export const isAuthReady = ref(false)
|
||||
export const currentUserId = ref('')
|
||||
|
||||
watch(isParentAuthenticated, (val) => {
|
||||
localStorage.setItem('isParentAuthenticated', val ? 'true' : 'false')
|
||||
if (hasLocalStorage && typeof localStorage.setItem === 'function') {
|
||||
localStorage.setItem('isParentAuthenticated', val ? 'true' : 'false')
|
||||
}
|
||||
})
|
||||
|
||||
export function authenticateParent() {
|
||||
@@ -15,7 +22,9 @@ export function authenticateParent() {
|
||||
|
||||
export function logoutParent() {
|
||||
isParentAuthenticated.value = false
|
||||
localStorage.removeItem('isParentAuthenticated')
|
||||
if (hasLocalStorage && typeof localStorage.removeItem === 'function') {
|
||||
localStorage.removeItem('isParentAuthenticated')
|
||||
}
|
||||
}
|
||||
|
||||
export function loginUser() {
|
||||
|
||||
Reference in New Issue
Block a user