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

This commit is contained in:
2026-02-01 16:57:12 -05:00
parent f14de28daa
commit e42c6c1ef2
16 changed files with 324 additions and 87 deletions

View File

@@ -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() {