forked from cory/tildefriends
Clean up apps list.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3938 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
parent
f787eb077b
commit
ac960a98bf
@ -498,13 +498,17 @@ async function blobHandler(request, response, blobId, uri) {
|
||||
(credentials.permissions.administration && user == 'core'))) {
|
||||
var database = new Database(user);
|
||||
var apps = new Set();
|
||||
let apps_original = database.get('apps');
|
||||
try {
|
||||
apps = new Set(JSON.parse(database.get('apps')));
|
||||
apps = new Set(JSON.parse(apps_original));
|
||||
} catch {
|
||||
}
|
||||
if (!apps.has(appName)) {
|
||||
apps.add(appName);
|
||||
database.set('apps', JSON.stringify([...apps]));
|
||||
}
|
||||
apps = JSON.stringify([...apps].sort());
|
||||
if (apps != apps_original) {
|
||||
database.set('apps', apps);
|
||||
}
|
||||
database.set('path:' + appName, newBlobId);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user