Skip to content

Conversation

BacLuc
Copy link
Contributor

@BacLuc BacLuc commented Sep 13, 2025

And show that this is needed if the vuex store is in strict mode.

…utations

And show that this is needed if the vuex store is in strict mode.
@@ -407,7 +407,10 @@ export function HalJsonVuexPlugin<RootEndpoint extends ResourceInterface, FullSt
function setLoadPromiseOnStore<StoreType> (uri: string, loadStoreData: Promise<StoreData<StoreType>> | null = null) {
const promise: SerializablePromise<StoreData<StoreType>> = loadStoreData || Promise.resolve(store.state[opts.apiName][uri])
promise.toJSON = () => '{}' // avoid warning in Nuxt when serializing the complete Vuex store ("Cannot stringify arbitrary non-POJOs Promise")
store.state[opts.apiName][uri]._meta.load = promise
store.commit('setLoadPromise', {
Copy link
Member

Choose a reason for hiding this comment

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

Have you read the comment on line 399? I think I had to do it this way, otherwise I would run into problems... Change LGTM, but I'm unsure because of that comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, somehow the comment is here again, deleted it in some somewhere along they way, now its here again..
Nice that the comment is there, but i don't know what the problems were then, i did not find any hints in the commit which added the comment, no tests broke...

I tried it against a ecamp3 with vue3 with a strict store, but i had not enough substance to test it. (We don't have any interactivity except the login which works yet...)
But with this change you can login, you can at least fetch some data without setting the store to strict:false.

And as you can see if you check out the change: if you set the store to strict, this change is needed.

If you can remember what the problem was then i am eager to hear it... else we will find this problem again if its still there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants