Initialization Bug Fixed
This commit is contained in:
1 parent
7ea65f7d68
commit
07d72e2ce0
2 files changed
+5
-10
No files matched your search
@@ -5,9 +5,9 @@ function newOnFocus () {
|
||||
return thisObject
|
||||
|
||||
function getNodeThatIsOnFocus (node) {
|
||||
if (node === undefined) { return }
|
||||
if (node === undefined || node === null) { return }
|
||||
if (node.payload === undefined) { return }
|
||||
let nodeDefinition = getNodeDefinition (node)
|
||||
let nodeDefinition = getNodeDefinition(node)
|
||||
if (nodeDefinition !== undefined) {
|
||||
/* First we ask the question to ourself */
|
||||
if (node.payload.uiObject.isOnFocus === true) {
|
||||
|
||||
@@ -67,6 +67,7 @@ function newWorkspace () {
|
||||
|
||||
thisObject.nodeChildren = newNodeChildren()
|
||||
|
||||
let isInitialized = false
|
||||
let workingAtTask = 0
|
||||
let circularProgressBar = newBusyProgressBar()
|
||||
circularProgressBar.fitFunction = canvas.floatingSpace.fitIntoVisibleArea
|
||||
@@ -118,6 +119,7 @@ function newWorkspace () {
|
||||
canvas.cockpitSpace.initializePosition()
|
||||
canvas.splashScreen.initialize()
|
||||
setInterval(saveWorkspace, 60000)
|
||||
isInitialized = true
|
||||
}
|
||||
} catch (err) {
|
||||
if (ERROR_LOG === true) { logger.write('[ERROR] initialize -> err = ' + err.stack) }
|
||||
@@ -186,17 +188,10 @@ function newWorkspace () {
|
||||
}
|
||||
|
||||
function saveWorkspace () {
|
||||
if (isInitialized === false) { return }
|
||||
/* When there is an exception while loading the app, the rootNodes of the workspace get into null value. To avoid saving a corrupt staate we are going to verufy we are not in that situation before saving. */
|
||||
let workspace = canvas.designSpace.workspace.workspaceNode
|
||||
|
||||
for (let i = 0; i < workspace.rootNodes.length; i++) {
|
||||
let rootNode = workspace.rootNodes[i]
|
||||
if (rootNode === null) {
|
||||
canvas.cockpitSpace.setStatus('Could not save the Workspace. The state of the workspace in memory is corrupt, please reload the App.', 150, canvas.cockpitSpace.statusTypes.WARNING)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
let savedSessionTimestamp = window.localStorage.getItem('Session Timestamp')
|
||||
if (Number(savedSessionTimestamp) !== sessionTimestamp) {
|
||||
canvas.cockpitSpace.setStatus('Could not save the Workspace. You have more that one instance of the Superlagos User Interface open at the same time. Plese close this instance as it is older than the others.', 150, canvas.cockpitSpace.statusTypes.WARNING)
|
||||
|
||||
Reference in new issue
Block a user