Skip to content

Commit 430a2a6

Browse files
authored
Merge pull request #46 from 8base/save-session
feat(file-input): save session after auth
2 parents a0c2ac7 + 91725b9 commit 430a2a6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

packages/file-input/src/FileInput.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const FileInput: React.ComponentType<FileInputProps> = withApollo(
2222
public static defaultProps = {
2323
maxFiles: 1,
2424
value: null,
25+
sessionCache: false,
2526
};
2627

2728
public static getDerivedStateFromProps(props: FileInputProps, state: FileInputState) {
@@ -53,7 +54,7 @@ const FileInput: React.ComponentType<FileInputProps> = withApollo(
5354
}
5455

5556
public async initFilestack() {
56-
const { client } = this.props;
57+
const { client, sessionCache } = this.props;
5758

5859
let response = null;
5960

@@ -74,6 +75,7 @@ const FileInput: React.ComponentType<FileInputProps> = withApollo(
7475
policy,
7576
signature,
7677
},
78+
sessionCache,
7779
});
7880
}
7981

packages/file-input/src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export type FileInputProps = {
2020
}) => React.ReactNode;
2121
public?: boolean;
2222
maxFiles?: number;
23+
sessionCache?: boolean;
2324
onUploadDone?: (value: FileInputValue, originalFile?: OriginalFileInputValue) => Promise<FileInputValue>;
2425
value?: FileInputValue | null;
2526
};

0 commit comments

Comments
 (0)