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

feat: Initialize cached values later #517

Merged
merged 1 commit into from
May 17, 2023
Merged

feat: Initialize cached values later #517

merged 1 commit into from
May 17, 2023

Conversation

susnux
Copy link
Contributor

@susnux susnux commented Mar 8, 2023

Currently the current user and the csrf token are initialized when the file is loaded, but this will fail when imported in tests without DOM or for SSR (e.g. nextcloud-vue docs). So instead the cached values are loaded on the first usage.

@susnux susnux added the enhancement New feature or request label Mar 8, 2023
| Nextcloud.v24.OC;
declare var OC: Nextcloud.v23.OC
| Nextcloud.v24.OC
| Nextcloud.v25.OC;
Copy link
Contributor

Choose a reason for hiding this comment

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

26 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

v26 is not provided by @nextcloud/typings

Copy link
Contributor

Choose a reason for hiding this comment

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

yet

Copy link
Contributor

Choose a reason for hiding this comment

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

That was my point yes 😉

Currently the current user and the csrf token are initialized when the file
is loaded, but this will fail when imported in tests without DOM or for SSR.
So instead the cached values are loaded on the first usage.

Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
@susnux susnux merged commit 20d2508 into master May 17, 2023
@susnux susnux deleted the feat/init-later branch May 17, 2023 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants