Skip to content
This repository was archived by the owner on May 13, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/server/static-react/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function Header({ onSettingsClick, onAiSettingsClick, onCloudSettingsClick }: He
let cancelled = false
const checkOrgSync = async () => {
try {
const hash = localStorage.getItem('fold_user_hash')
const hash = localStorage.getItem(BROWSER_CONFIG.STORAGE_KEYS.USER_HASH)
if (!hash) return
const res = await defaultApiClient.get('/org')
const data = ((res as { data?: unknown }).data ?? res) as { orgs?: Array<{ org_hash: string }> }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useCallback, useEffect, useState } from 'react'
import { InboxArrowDownIcon } from '@heroicons/react/24/outline'
import { mutationClient } from '../../api/clients'
import { SCHEMA_BADGE_COLORS } from '../../constants/ui'
import { BROWSER_CONFIG } from '../../constants/config'
import {
createHashRangeKeyFilter,
createHashKeyFilter,
Expand Down Expand Up @@ -241,7 +242,7 @@ export function VersionHistory({ moleculeUuid }: { moleculeUuid: string | null |
const IMAGE_EXTENSIONS = /\.(jpe?g|png|gif|webp|svg)$/i

function authHeaders(): Record<string, string> {
const userHash = localStorage.getItem('fold_user_hash')
const userHash = localStorage.getItem(BROWSER_CONFIG.STORAGE_KEYS.USER_HASH)
if (!userHash) return {}
return { 'x-user-hash': userHash, 'x-user-id': userHash }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useState, useEffect, useRef, type FormEvent } from 'react'
import { defaultApiClient } from '../../api/core/client'
import { systemClient } from '../../api/clients/systemClient'
import { orgClient, type OrgInviteBundle, type OrgMemberInfo, type CloudMember } from '../../api/clients/orgClient'
import { BROWSER_CONFIG } from '../../constants/config'

interface Org {
org_hash: string
Expand Down Expand Up @@ -52,7 +53,7 @@ export default function OrgSettingsPanel() {

useEffect(() => {
const doFetch = () => {
const hash = localStorage.getItem('fold_user_hash')
const hash = localStorage.getItem(BROWSER_CONFIG.STORAGE_KEYS.USER_HASH)
if (!hash) {
const timer = setTimeout(doFetch, 1000)
return () => clearTimeout(timer)
Expand Down
3 changes: 2 additions & 1 deletion src/server/static-react/src/components/tabs/IngestionTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { ingestionClient } from '../../api/clients'
import { defaultApiClient } from '../../api/core/client'
import { generateBlogPosts } from '../../data/sampleBlogPosts'
import { twitterSamples, instagramSamples, linkedinSamples, tiktokSamples } from '../../data/sampleSocialPosts'
import { BROWSER_CONFIG } from '../../constants/config'

const SAMPLES_ENABLED = import.meta.env.VITE_ENABLE_SAMPLES === 'true'

Expand Down Expand Up @@ -31,7 +32,7 @@ function IngestionTab({ onResult }: IngestionTabProps) {
const maxRetries = 5
const fetchOrgs = () => {
if (cancelled) return
const hash = localStorage.getItem('fold_user_hash')
const hash = localStorage.getItem(BROWSER_CONFIG.STORAGE_KEYS.USER_HASH)
if (!hash) {
retries++
if (retries < maxRetries) setTimeout(fetchOrgs, 1000)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { useFilesProgress } from '../../hooks/useFilesProgress'
import FolderInput from './smart-folder/FolderInput'
import ScanResultsView from './smart-folder/ScanResultsView'
import BatchProgressView from './smart-folder/BatchProgressView'
import { BROWSER_CONFIG } from '../../constants/config'

const STORAGE_KEY = 'smartFolderTabState'

Expand Down Expand Up @@ -90,7 +91,7 @@ function SmartFolderTab({ onResult: onResultProp }: SmartFolderTabProps) {
const maxRetries = 5
const fetchOrgs = () => {
if (cancelled) return
const hash = localStorage.getItem('fold_user_hash')
const hash = localStorage.getItem(BROWSER_CONFIG.STORAGE_KEYS.USER_HASH)
if (!hash) {
retries++
if (retries < maxRetries) setTimeout(fetchOrgs, 1000)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useEffect, useState } from 'react'
import { BROWSER_CONFIG } from '../../../constants/config'

interface ImageThumbnailProps {
fileHash: string
Expand All @@ -12,7 +13,7 @@ export default function ImageThumbnail({ fileHash, sourceFile }: ImageThumbnailP
useEffect(() => {
const url = `/api/file/${fileHash}?name=${encodeURIComponent(sourceFile || '')}`
let revoked = false
const userHash = localStorage.getItem('fold_user_hash')
const userHash = localStorage.getItem(BROWSER_CONFIG.STORAGE_KEYS.USER_HASH)
const headers: Record<string, string> = {}
if (userHash) {
headers['x-user-hash'] = userHash
Expand Down
Loading