-
Notifications
You must be signed in to change notification settings - Fork 30
[feature] UEPR-252 Implement manual update of project thumbnails #264
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
Changes from all commits
97385d0
2f67379
bf42a35
168437b
9b1c860
c48f364
daa9fb5
d18113e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import log from './log'; | ||
|
||
export const storeProjectThumbnail = (vm, callback) => { | ||
try { | ||
getProjectThumbnail(vm, callback); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "store" calls "get"? Hm? Does this also save the project thumbnail to the backend? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, the callback saves it, the vm makes a snapshot of the current state. |
||
} catch (e) { | ||
log.error('Project thumbnail save error', e); | ||
// This is intentionally fire/forget because a failure | ||
// to save the thumbnail is not vitally important to the user. | ||
} | ||
}; | ||
|
||
export const getProjectThumbnail = (vm, callback) => { | ||
vm.postIOData('video', {forceTransparentPreview: true}); | ||
vm.renderer.requestSnapshot(dataURI => { | ||
vm.postIOData('video', {forceTransparentPreview: false}); | ||
callback(dataURI); | ||
}); | ||
vm.renderer.draw(); | ||
}; |
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.
Thumbnail saves are currently done through the Storage interface - there is a
saveProjectThumbnail
method that is currently called. Is that still called to save the thumbnail to the server? And this is just to notify that the user saved it, right?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.
As discussed offline, the store's
saveProjectThumbnail
is used as fallback when the onUpdate callback isn't passed - which is the case in NGP