forked from cory/tildefriends
Async File.writeFile.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3673 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
@ -272,11 +272,10 @@ function getGlobalSettings() {
|
||||
|
||||
function setGlobalSettings(settings) {
|
||||
makeDirectoryForFile(kGlobalSettingsFile);
|
||||
if (!File.writeFile(kGlobalSettingsFile, JSON.stringify(settings))) {
|
||||
gGlobalSettings = settings;
|
||||
} else {
|
||||
throw new Error("Unable to save settings.");
|
||||
}
|
||||
gGlobalSettings = settings;
|
||||
return File.writeFile(kGlobalSettingsFile, JSON.stringify(settings)).catch(function(error) {
|
||||
throw new Error("Unable to save settings: " + error);
|
||||
});
|
||||
}
|
||||
|
||||
var kStaticFiles = [
|
||||
|
Reference in New Issue
Block a user