Skip to content

Commit

Permalink
Better feedback on verification delay.
Browse files Browse the repository at this point in the history
Fixes ChrisBoesch#42

It would not show the message about the delayed verification if the status was unknown.

Possible improvement:
- Display the message if the verification takes more than 6s.
- Display a timer for the expected delay.
  • Loading branch information
dinoboff committed Aug 18, 2015
1 parent e22549c commit e7181e9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/singpath/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@
});
},

verifierStatus: function() {
return $http.get('/api/verifier').then(function(resp) {
return resp.data;
});
},

paths: {
_Factory: spfFirebase.objFactory({
$canBeEditedBy: function(user) {
Expand Down
6 changes: 4 additions & 2 deletions src/singpath/components/problems/problems.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit e7181e9

Please sign in to comment.