diff --git a/.github/workflows/build-deploy-merge.yml b/.github/workflows/build-deploy-merge.yml index dffd997..f47309a 100644 --- a/.github/workflows/build-deploy-merge.yml +++ b/.github/workflows/build-deploy-merge.yml @@ -46,10 +46,10 @@ jobs: credentials_json: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_BS3APP_DFB63 }}' - name: Deploy functions - run: firebase deploy --only functions --project bs3app-dfb63 + run: firebase deploy --only functions --project bs3app-dfb63 --force working-directory: ./bs3-functions env: - PERPLEXITY_SONAR_API_KEY: ${{ secrets.PERPLEXITY_SONAR_API_KEY }} + PERPLEXITY_SONAR_API_KEY: dummy-api-key-change-me - name: Deploy to Firebase Hosting uses: FirebaseExtended/action-hosting-deploy@v0 diff --git a/bs3/src/app/store.ts b/bs3/src/app/store.ts index 677b5f1..82d4573 100644 --- a/bs3/src/app/store.ts +++ b/bs3/src/app/store.ts @@ -4,7 +4,7 @@ import geolocatorReducer from './geolocatorSlice'; export const store = configureStore({ reducer: { - app: firestoreReducer, + firestore: firestoreReducer, geolocation: geolocatorReducer, }, }); diff --git a/bs3/src/components/bottom-app-bar.tsx b/bs3/src/components/bottom-app-bar.tsx index c33ff7b..c6fc2e7 100644 --- a/bs3/src/components/bottom-app-bar.tsx +++ b/bs3/src/components/bottom-app-bar.tsx @@ -35,7 +35,7 @@ HideOnScroll.propTypes = { // Define the types for the Redux state interface AppState { - app: { + firestore: { user: string; }; geolocation: { @@ -46,7 +46,7 @@ interface AppState { } export default function BottomAppBar(): JSX.Element { - const user = useSelector((state: AppState) => state.app.user); + const user = useSelector((state: AppState) => state.firestore.user); const location = useSelector((state: AppState) => state.geolocation.location); return ( diff --git a/bs3/src/components/comments-section.tsx b/bs3/src/components/comments-section.tsx index 7b8ef1d..479c222 100644 --- a/bs3/src/components/comments-section.tsx +++ b/bs3/src/components/comments-section.tsx @@ -25,7 +25,7 @@ function CommentsSection({ postId }: CommentsSectionProps) { const textAreaRef = useRef(null); - const userId = useAppSelector(state => state.app.user); + const userId = useAppSelector(state => state.firestore.user); const location = useAppSelector(state => state.geolocation.location); useEffect(() => { diff --git a/bs3/src/components/post-card.tsx b/bs3/src/components/post-card.tsx index d35e0c2..377d82a 100644 --- a/bs3/src/components/post-card.tsx +++ b/bs3/src/components/post-card.tsx @@ -57,7 +57,7 @@ export default function BasicCard({ post, extended = false }: BasicCardProps) { const [deleteWarningOpen, setDeleteWarningOpen] = useState(false); const [commentsCount, setCommentsCount] = useState(0); - const userId = useAppSelector(state => state.app.user); + const userId = useAppSelector(state => state.firestore.user); const location = useAppSelector(state => state.geolocation.location); const [thisPost, setThisPost] = useState({ diff --git a/bs3/src/pages/new-post-form.tsx b/bs3/src/pages/new-post-form.tsx index 61efd0d..977c8a2 100644 --- a/bs3/src/pages/new-post-form.tsx +++ b/bs3/src/pages/new-post-form.tsx @@ -61,7 +61,7 @@ export default function PostForm(): JSX.Element { const navigate = useNavigate(); const dispatch = useAppDispatch(); - const userId = useAppSelector((state) => state.app.user); + const userId = useAppSelector((state) => state.firestore.user); const location = useAppSelector((state) => state.geolocation.location); const [open, setOpen] = useState(!location.local); diff --git a/bs3/src/pages/post-detail.tsx b/bs3/src/pages/post-detail.tsx index fd44b40..bbef7f4 100644 --- a/bs3/src/pages/post-detail.tsx +++ b/bs3/src/pages/post-detail.tsx @@ -24,7 +24,7 @@ export const idLoader: LoaderFunction = ({ params }: LoaderArgs) => { function Post(): JSX.Element { const postId = useLoaderData() as string; const post = useSelector((state: RootState) => - state.app.posts.find((item) => item.id === postId) + state.firestore.posts.find((item) => item.id === postId) ); if (!post) { diff --git a/bs3/src/pages/post-list.tsx b/bs3/src/pages/post-list.tsx index 76d847d..1b34a44 100644 --- a/bs3/src/pages/post-list.tsx +++ b/bs3/src/pages/post-list.tsx @@ -45,7 +45,7 @@ interface SnackBarState { // PostListPage component export default function PostListPage(): JSX.Element { const dispatch = useAppDispatch(); - const posts = useAppSelector((state: RootState) => state.app.posts); + const posts = useAppSelector((state: RootState) => state.firestore.posts); const location = useLocation(); let snackBar: SnackBarState = { open: false, postId: null };