Fixed bug of uploading
This commit is contained in:
parent
d56093fa80
commit
2fec0ffea0
1 changed files with 5 additions and 6 deletions
|
|
@ -308,7 +308,7 @@ export function FlowsProvider({ children }: { children: ReactNode }) {
|
||||||
let text = await file.text();
|
let text = await file.text();
|
||||||
let fileData = JSON.parse(text);
|
let fileData = JSON.parse(text);
|
||||||
if (
|
if (
|
||||||
(fileData.is_component === undefined && isComponent === true) ||
|
(fileData.is_component === undefined && isComponent === false) ||
|
||||||
(fileData.is_component !== undefined &&
|
(fileData.is_component !== undefined &&
|
||||||
fileData.is_component !== isComponent)
|
fileData.is_component !== isComponent)
|
||||||
) {
|
) {
|
||||||
|
|
@ -339,11 +339,10 @@ export function FlowsProvider({ children }: { children: ReactNode }) {
|
||||||
let fileData: FlowType = await JSON.parse(text);
|
let fileData: FlowType = await JSON.parse(text);
|
||||||
console.log(isComponent, fileData);
|
console.log(isComponent, fileData);
|
||||||
|
|
||||||
if (fileData.is_component === undefined) {
|
if (
|
||||||
reject("Your file doesn't have the is_component property.");
|
(fileData.is_component === undefined && isComponent === false) ||
|
||||||
} else if (
|
(fileData.is_component !== undefined &&
|
||||||
fileData.is_component !== undefined &&
|
fileData.is_component !== isComponent)
|
||||||
fileData.is_component !== isComponent
|
|
||||||
) {
|
) {
|
||||||
reject("You cannot upload a component as a flow or vice versa");
|
reject("You cannot upload a component as a flow or vice versa");
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue