mirror of
https://github.com/supabase/supabase.git
synced 2026-10-17 15:19:08 +03:00
Add guard in createBucket within StorageExplorerStore
This commit is contained in:
1 parent
0e6bad7244
commit
52fa1a4e97
1 file changed
+7
-2
@@ -6,8 +6,9 @@ import {
|
||||
compact,
|
||||
isEqual,
|
||||
isNull,
|
||||
has,
|
||||
isNil,
|
||||
isUndefined,
|
||||
has,
|
||||
some,
|
||||
chunk,
|
||||
get,
|
||||
@@ -376,11 +377,15 @@ class StorageExplorerStore {
|
||||
/* Bucket CRUD */
|
||||
|
||||
createBucket = async (bucketName, isPublic = false) => {
|
||||
if (isNil(this.supabaseClient)) {
|
||||
return toast.error('Failed to initialize supabase client, try refreshing your browser.')
|
||||
}
|
||||
|
||||
const { error } = await this.supabaseClient.storage.createBucket(bucketName, {
|
||||
public: isPublic,
|
||||
})
|
||||
if (error) {
|
||||
toast(error.message)
|
||||
toast.error(error.message)
|
||||
return this.closeCreateBucketModal()
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user