diff --git a/docker-compose.yml b/docker-compose.yml index 2a71f05..bd46025 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,7 @@ services: ports: - "6925:80" volumes: - - images_data:/app/images:ro + - /volume1/docker/storycove/images:/app/images:ro configs: - source: nginx_config target: /etc/nginx/nginx.conf @@ -42,9 +42,9 @@ services: - APP_PASSWORD=${APP_PASSWORD} - STORYCOVE_CORS_ALLOWED_ORIGINS=${STORYCOVE_CORS_ALLOWED_ORIGINS:-http://localhost:3000,http://localhost:6925} volumes: - - images_data:/app/images - - library_config:/app/config - - automatic_backups:/app/automatic-backups + - /volume1/docker/storycove/images:/app/images + - /volume1/docker/storycove/config:/app/config + - /volume1/docker/storycove/backups:/app/automatic-backups depends_on: postgres: condition: service_healthy @@ -63,7 +63,7 @@ services: - POSTGRES_USER=storycove - POSTGRES_PASSWORD=${DB_PASSWORD} volumes: - - postgres_data:/var/lib/postgresql/data + - /volume1/docker/storycove/postgres:/var/lib/postgresql/data networks: - storycove-network healthcheck: @@ -83,7 +83,7 @@ services: - SOLR_HEAP=512m - SOLR_JAVA_MEM=-Xms256m -Xmx512m volumes: - - solr_data:/var/solr + - /volume1/docker/storycove/solr:/var/solr deploy: resources: limits: @@ -102,13 +102,6 @@ services: restart: unless-stopped -volumes: - postgres_data: - solr_data: - images_data: - library_config: - automatic_backups: - configs: nginx_config: content: | diff --git a/frontend/src/components/stories/StoryCard.tsx b/frontend/src/components/stories/StoryCard.tsx index e3730a3..64c011a 100644 --- a/frontend/src/components/stories/StoryCard.tsx +++ b/frontend/src/components/stories/StoryCard.tsx @@ -1,6 +1,6 @@ 'use client'; -import { useState } from 'react'; +import { useState, useEffect } from 'react'; import Link from 'next/link'; import Image from 'next/image'; import { Story } from '../../types/api'; @@ -49,6 +49,12 @@ export default function StoryCard({ const [rating, setRating] = useState(story.rating || 0); const [updating, setUpdating] = useState(false); + // Sync rating state when a different story is rendered in the same component slot, + // or when the story's rating is updated externally (e.g. from the detail page). + useEffect(() => { + setRating(story.rating || 0); + }, [story.id, story.rating]); + // Helper function to get tags from either tags array or tagNames array const getTags = () => { if (Array.isArray(story.tags) && story.tags.length > 0) { diff --git a/frontend/src/components/stories/StoryRating.tsx b/frontend/src/components/stories/StoryRating.tsx index bf00606..4661d97 100644 --- a/frontend/src/components/stories/StoryRating.tsx +++ b/frontend/src/components/stories/StoryRating.tsx @@ -37,7 +37,7 @@ export default function StoryRating({ } }; - const displayRating = hoveredRating || rating; + const displayRating = hoveredRating || (rating || 0); return (