feat: rebrand site to CineK

This commit is contained in:
ngthanhvu
2026-05-24 22:35:13 +07:00
parent f2479074df
commit 30502c9854
25 changed files with 693 additions and 442 deletions
+7 -3
View File
@@ -13,7 +13,8 @@ export type WatchHistoryItem = {
updatedAt?: number
}
const watchHistoryKey = 'kr-phim-watch-history'
const watchHistoryKey = 'cinek-watch-history'
const legacyWatchHistoryKey = 'kr-phim-watch-history'
function normalizeHistoryItem(item: any): WatchHistoryItem | null {
const slug = item?.slug
@@ -43,7 +44,7 @@ function readLocalHistory() {
if (!import.meta.client) return []
try {
const raw = window.localStorage.getItem(watchHistoryKey)
const raw = window.localStorage.getItem(watchHistoryKey) || window.localStorage.getItem(legacyWatchHistoryKey)
const history = raw ? JSON.parse(raw) : []
return Array.isArray(history)
@@ -149,7 +150,10 @@ export function useWatchHistory() {
}
async function clearWatchHistory() {
if (import.meta.client) window.localStorage.removeItem(watchHistoryKey)
if (import.meta.client) {
window.localStorage.removeItem(watchHistoryKey)
window.localStorage.removeItem(legacyWatchHistoryKey)
}
if (user.value) {
await $supabase