Finding a stopping point :(

This commit is contained in:
2025-06-15 13:27:48 -05:00
parent 6c85c973b9
commit bc915275cf
15 changed files with 863 additions and 624 deletions

View File

@ -1,7 +1,7 @@
'use client';
import { createClient } from '@/utils/supabase';
import type { Profile, Result } from '@/utils/supabase';
import { getUser, getProfile, getSignedUrl } from '@/lib/hooks';
import { getUser, getOriginalProfile, getSignedUrl } from '@/lib/hooks';
export type UserWithStatus = {
id?: string;
@ -67,9 +67,9 @@ export const getRecentUsersWithStatuses = async (): Promise<
for (const userWithStatus of filtered) {
if (userWithStatus.user.avatar_url)
userWithStatus.user.avatar_url =
await getAvatarUrl(userWithStatus.updated_by?.avatar_url);
await getAvatarUrl(userWithStatus.user.avatar_url);
if (userWithStatus.updated_by?.avatar_url)
userWithStatus.user.avatar_url =
userWithStatus.updated_by.avatar_url =
await getAvatarUrl(userWithStatus.updated_by?.avatar_url);
filteredWithAvatars.push(userWithStatus);
}
@ -115,7 +115,7 @@ export const updateStatuses = async (
): Promise<Result<void>> => {
try {
const supabase = createClient();
const profileResponse = await getProfile();
const profileResponse = await getOriginalProfile();
if (!profileResponse.success) throw new Error('Not authenticated!');
const user = profileResponse.data;
@ -155,7 +155,7 @@ export const updateUserStatus = async (
): Promise<Result<void>> => {
try {
const supabase = createClient();
const profileResponse = await getProfile();
const profileResponse = await getOriginalProfile();
if (!profileResponse.success)
throw new Error(`Not authenticated! ${profileResponse.error}`);
const userProfile = profileResponse.data;