Skip to content

Commit

Permalink
Remove token from tlonHosting method
Browse files Browse the repository at this point in the history
  • Loading branch information
guaraqe committed Oct 17, 2023
1 parent 40ca463 commit c1857ce
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion ui/src/state/storage/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export const useStorage = createState<BaseStorageState>(
backend: 'tlon-hosting',
tlonHosting: {
endpoint: 'http://localhost:8888',
token: 'token',
},
s3: {
configuration: {
Expand Down
1 change: 0 additions & 1 deletion ui/src/state/storage/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export interface GcpToken {

export interface StorageCredentialsTlonHosting {
endpoint: string;
token: string;
}

export type StorageBackend = 's3' | 'tlon-hosting';
Expand Down
6 changes: 3 additions & 3 deletions ui/src/state/storage/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ function useS3Client() {
const selUploader = (key: string) => (s: FileStore) => s.uploaders[key];
export function useUploader(key: string): Uploader | undefined {
const {
tlonHosting: { token },
tlonHosting: { endpoint },
s3: {
configuration: { currentBucket },
},
Expand All @@ -306,7 +306,7 @@ export function useUploader(key: string): Uploader | undefined {
const uploader = useFileStore(selUploader(key));

useEffect(() => {
if ((s3Client && currentBucket) || token) {
if ((s3Client && currentBucket) || endpoint) {
useFileStore.setState(
produce((draft) => {
draft.uploaders[key] = emptyUploader(key, currentBucket);
Expand All @@ -321,7 +321,7 @@ export function useUploader(key: string): Uploader | undefined {
})
);
};
}, [s3Client, currentBucket, key, token]);
}, [s3Client, currentBucket, key, endpoint]);

return uploader;
}
Expand Down

0 comments on commit c1857ce

Please sign in to comment.