Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ export function useStore(
}
}
if (vueVersion.value) files._version = vueVersion.value
if (typescriptVersion.value) files._tsVersion = typescriptVersion.value
Copy link
Collaborator

Choose a reason for hiding this comment

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

🤔 I wonder if typescriptVersion === latest can be ignored ?
By default, all data may have a _tsVersion file.
But the default vueVersion is null.

Copy link
Contributor Author

@huangmingfu huangmingfu Feb 19, 2025

Choose a reason for hiding this comment

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

No, if the ts version is not transmitted, request 404.

const store = (window.store = useStore(
  {
    //  ...
    // typescriptVersion: ref('4.9.3')
  },
  location.hash,
))

image

My latest submission has solved this problem.
image
It is similar to the writing of vue version request.
image

return '#' + utoa(JSON.stringify(files))
}
const deserialize: ReplStore['deserialize'] = (
Expand All @@ -289,7 +290,10 @@ export function useStore(
for (const filename in saved) {
if (filename === '_version') {
vueVersion.value = saved[filename]
} else {
} else if (filename === '_tsVersion') {
typescriptVersion.value = saved[filename]
}
else {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hope to fix the code format npm run format

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, I've already changed it

setFile(files.value, filename, saved[filename])
}
}
Expand Down