Adding multiplayer markdeep.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3291 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2016-07-31 14:23:47 +00:00
parent cca505ff01
commit 085b44752a
3 changed files with 200 additions and 11 deletions

View File

@ -83,17 +83,14 @@ function notifyChanged() {
return core.broadcast({changed: true});
}
function readList(key) {
return database.get(key).catch(function(error) {
return null;
}).then(function(todo) {
try {
todo = JSON.parse(todo);
} catch (error) {
todo = {name: "TODO", items: []};
}
return todo;
});
async function readList(key) {
let todo = null;
try {
todo = JSON.parse(await database.get(key));
} catch (error) {
todo = {name: "TODO", items: []};
}
return todo;
}
function writeList(key, todo) {