diff --git a/src/singpath/app.js b/src/singpath/app.js index abd63d5..dbe886a 100644 --- a/src/singpath/app.js +++ b/src/singpath/app.js @@ -183,6 +183,12 @@ }); }, + verifierStatus: function() { + return $http.get('/api/verifier').then(function(resp) { + return resp.data; + }); + }, + paths: { _Factory: spfFirebase.objFactory({ $canBeEditedBy: function(user) { diff --git a/src/singpath/components/problems/problems.js b/src/singpath/components/problems/problems.js index 7aff2bc..3419924 100644 --- a/src/singpath/components/problems/problems.js +++ b/src/singpath/components/problems/problems.js @@ -474,9 +474,11 @@ self.profileNeedsUpdate = !self.currentUser.$completed(); }).then(function() { return spfDataStore.solutions.create(problem, currentUser.publicId, solution); - }).then(function(resp) { - self.serverIsRunning = resp.serverIsRunning; + }).then(function() { spfAlert.success('Solution saved'); + return spfDataStore.verifierStatus(); + }).then(function(serverInfo) { + self.serverIsRunning = serverInfo.status === 'running'; }).catch(function(err) { spfAlert.error(err.message || err.toString()); }).finally(function() {