Mercurial Hosting > freedit
diff src/lib/Config.luan @ 18:94e26bffd4fb
UI work
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 11 Jul 2022 12:14:05 -0600 |
parents | fc2383eb48a9 |
children |
line wrap: on
line diff
--- a/src/lib/Config.luan Thu Jul 07 15:30:06 2022 -0600 +++ b/src/lib/Config.luan Mon Jul 11 12:14:05 2022 -0600 @@ -15,9 +15,11 @@ Config.text = doc and doc.config or Config.default_text function Config.set(text) - local doc = Db.get_document("type:config") or {type="config"} - doc.config = text - Db.save(doc) + Db.run_in_transaction( function() + local doc = Db.get_document("type:config") or {type="config"} + doc.config = text + Db.save(doc) + end ) end return Config