mirror of
https://github.com/urbit/shrub.git
synced 2024-12-19 08:32:39 +03:00
interface: check accessKey !== undefined
Also make it type-level optional rather than using explicit null. Perhaps one day we will want to use undefined to denote "the thread hasn't returned yet" and null for "GCP Storage is not configured." Perhaps.
This commit is contained in:
parent
6b3397bd9f
commit
723a5a050e
@ -23,7 +23,7 @@ const useStorage = (s3: S3State, gcp: GcpState,
|
||||
|
||||
useEffect(() => {
|
||||
// prefer GCP if available, else use S3.
|
||||
if (gcp.accessKey) {
|
||||
if (gcp.accessKey !== undefined) {
|
||||
client.current = new GcpClient(gcp.accessKey);
|
||||
} else {
|
||||
if (!s3.credentials) {
|
||||
|
@ -73,9 +73,7 @@ export default class GlobalStore extends BaseStore<StoreState> {
|
||||
},
|
||||
weather: {},
|
||||
userLocation: null,
|
||||
gcp: {
|
||||
accessKey: null
|
||||
},
|
||||
gcp: {},
|
||||
s3: {
|
||||
configuration: {
|
||||
buckets: new Set(),
|
||||
|
@ -4,5 +4,5 @@ export interface GcpToken {
|
||||
};
|
||||
|
||||
export interface GcpState {
|
||||
accessKey: string;
|
||||
accessKey?: string;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user