app/js/tree_logic.js
// Reads tree from workspaces tree json and initializes that tree
Reads tree from workspaces tree json and initializes that tree
Reads tree from workspaces tree json and initializes that tree
function readTree(workspace) {
    console.log('read_tree called');
    fs.readFile(appDataPath + "/workspace_repo/" + workspace + "/tree.json", 'utf-8', (err, data) => {
        if (err) {
            alert("An error occurred reading the tree file :" + err.message);
            return;
        }
        console.log("The tree file content is : " + data);
        if (data.length > 0) {
            makeTree(workspace, JSON.parse(data));
        }
    });
}
function readTree ( workspace ) { console . log ( 'read_tree called' ) ; fs . readFile ( appDataPath + "/workspace_repo/" + workspace + "/tree.json" , 'utf-8' , ( err , data ) => { if ( err ) { alert ( "An error occurred reading the tree file :" + err . message ) ; return ; } console . log ( "The tree file content is : " + data ) ; if ( data . length > 0 ) { makeTree ( workspace , JSON . parse ( data ) ) ; } } ) ; }
Reads tree from workspaces tree json and initializes that tree
Reads tree from workspaces tree json and initializes that tree
// If json contains tree data: make a tree