Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(content-preview): Pass token generator to preview library #1689

Merged
merged 2 commits into from
Oct 31, 2019

Conversation

mxiao6
Copy link
Contributor

@mxiao6 mxiao6 commented Oct 23, 2019

The related preview change: box/box-content-preview#1087

@mxiao6 mxiao6 requested a review from a team as a code owner October 23, 2019 22:49
@mxiao6 mxiao6 requested a review from a team October 23, 2019 22:49
@boxcla
Copy link

boxcla commented Oct 23, 2019

Verified that @mxiao6 has signed the CLA. Thanks for the pull request!

@@ -700,8 +700,7 @@ class ContentPreview extends React.PureComponent<Props, State> {
}

const fileOpts = { ...fileOptions };
const typedId: string = getTypedFileId(fileId);
const token: TokenLiteral = await TokenService.getReadToken(typedId, tokenOrTokenFunction);
const token = typedId => TokenService.getReadTokens(typedId, tokenOrTokenFunction);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we even need the argument in the token function? Since we know what file we're generating the token for, can we instead do const token = () => TokenService.getReadToken(typedId, tokenOrTokenFunction)?

Copy link
Contributor Author

@mxiao6 mxiao6 Oct 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I get rid of the argument, I have to change the preview lib's getTokens function, which I don't think we should touch.

@mxiao6 mxiao6 requested a review from a team October 30, 2019 22:52
@mergify mergify bot merged commit 38469a9 into box:master Oct 31, 2019
@mxiao6 mxiao6 deleted the token-generator branch November 26, 2019 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants