Skip to content

Commit

Permalink
chore: forbidden to set apikey
Browse files Browse the repository at this point in the history
  • Loading branch information
myWsq committed Apr 18, 2023
1 parent 4b6183b commit d30b699
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/components/Menu/MenuOptions/MenuOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const MenuOptions = () => {
{googleClientId && <GoogleSync clientId={googleClientId} />}
<ClearConversation />
<ImportExportChat />
<Api />
<SettingsMenu />
</div>
</>
Expand Down
7 changes: 2 additions & 5 deletions src/store/auth-slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,11 @@ export interface AuthSlice {
}

export const createAuthSlice: StoreSlice<AuthSlice> = (set, get) => ({
apiKey: import.meta.env.VITE_OPENAI_API_KEY || undefined,
apiKey: localStorage.getItem('openaimax_api_key') || undefined,
apiEndpoint: defaultAPIEndpoint,
firstVisit: true,
setApiKey: (apiKey: string) => {
set((prev: AuthSlice) => ({
...prev,
apiKey: apiKey,
}));
throw new Error('forbidden to set api key')
},
setApiEndpoint: (apiEndpoint: string) => {
set((prev: AuthSlice) => ({
Expand Down
2 changes: 1 addition & 1 deletion src/store/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const useStore = create<StoreState>()(
...createToastSlice(set, get),
}),
{
name: 'free-chat-gpt',
name: 'openaimax-chat-gpt',
partialize: (state) => createPartializedState(state),
version: 8,
migrate: (persistedState, version) => {
Expand Down

0 comments on commit d30b699

Please sign in to comment.