1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-08-01 06:50:26 +02:00

Add favorite functionality

This commit is contained in:
Kamran Ahmed
2023-11-12 18:50:00 +00:00
parent 068847af08
commit be02cc59ea
2 changed files with 2 additions and 2 deletions

View File

@@ -10,7 +10,7 @@ import { FriendProgressItem } from './FriendProgressItem';
import { UserProgressModal } from '../UserProgress/UserProgressModal';
import { InviteFriendPopup } from './InviteFriendPopup';
import { UserCustomProgressModal } from '../UserProgress/UserCustomProgressModal';
import {UserIcon} from "lucide-react";
import { UserIcon } from 'lucide-react';
type FriendResourceProgress = {
updatedAt: string;

View File

@@ -96,7 +96,7 @@ export async function getResourceProgress(
const userId = getUser()?.id;
const progressKey = `${resourceType}-${resourceId}-${userId}-progress`;
const isFavoriteKey = `${resourceType}-${resourceId}-${userId}-favorite`;
const isFavoriteKey = `${resourceType}-${resourceId}-favorite`;
const rawIsFavorite = localStorage.getItem(isFavoriteKey);
const isFavorite = JSON.parse(rawIsFavorite || '0') === 1;