-
Notifications
You must be signed in to change notification settings - Fork 588
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
Force version history to update when restoring a version or sharing #9718
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question but otherwise LGTM!
@@ -375,6 +375,51 @@ namespace pxt.workspace { | |||
toWrite[pxt.HISTORY_FILE] = JSON.stringify(history); | |||
} | |||
|
|||
export function pushSnapshotOnHistory(text: ScriptText, currentTime: number) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in saveSnapshotAsync in workspace.ts
@@ -375,6 +375,51 @@ namespace pxt.workspace { | |||
toWrite[pxt.HISTORY_FILE] = JSON.stringify(history); | |||
} | |||
|
|||
export function pushSnapshotOnHistory(text: ScriptText, currentTime: number) { | |||
let history: pxt.workspace.HistoryFile; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not super necessary, and there might also be something that I'm missing, but have you considered putting this let history .. if .. else..
chunk in a separate function to limit repeated code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's slightly different in each function, sadly
Fixes https://github.com/microsoft/pxt-minecraft/issues/2356
Three version history fixes: