Only show greeting once userConfig is fetched from server

- Pass userConfig from Home as prop to chatBodyData component with
  loading state
- Pass loading state of userConfig to allow components to handle
  rendering dependent elements once it is loaded
This commit is contained in:
Debanjum Singh Solanky
2024-08-02 20:03:51 +05:30
parent 0adee07d40
commit e62888659f
3 changed files with 26 additions and 11 deletions

View File

@@ -348,7 +348,7 @@ export default function SettingsView() {
const [title, setTitle] = useState("Settings");
const [isMobileWidth, setIsMobileWidth] = useState(false);
const { apiKeys, generateAPIKey, copyAPIKey, deleteAPIKey } = useApiKeys();
const initialUserConfig = useUserConfig(true);
const {userConfig: initialUserConfig} = useUserConfig(true);
const [userConfig, setUserConfig] = useState<UserConfig | null>(null);
const [name, setName] = useState<string | undefined>(undefined);
const [notionToken, setNotionToken] = useState<string | null>(null);