MCPcopy Index your code
hub / github.com/microsoft/SandDance / changeDataSource

Method changeDataSource

docs/app/js/sanddance-app.js:51753–51779  ·  view source on GitHub ↗
(dataSource)

Source from the content-addressed store, hash-verified

51751 };
51752 }
51753 changeDataSource(dataSource) {
51754 this.setState({
51755 working: true
51756 });
51757 return new Promise((resolve, reject)=>{
51758 const uploadFormatError = "";
51759 const urlError = "";
51760 this.setState({
51761 uploadFormatError,
51762 urlError
51763 });
51764 this.props.changeDataSource(dataSource).then(()=>{
51765 this.setState({
51766 working: false,
51767 uploadFormatError: "",
51768 urlError: "",
51769 dialogMode: null
51770 });
51771 resolve();
51772 }).catch((reason)=>{
51773 this.setState({
51774 working: false
51775 });
51776 reject(reason);
51777 });
51778 });
51779 }
51780 upload(e) {
51781 if (e.target.files) {
51782 const file = e.target.files[0];

Callers 3

uploadMethod · 0.95
loadUrlMethod · 0.95
DataSourceButtonFunction · 0.45

Calls 2

rejectFunction · 0.85
resolveFunction · 0.70

Tested by

no test coverage detected