Use a static array instead of a stray variable for DataBoard keys.

This commit is contained in:
Mayhem 2013-08-14 17:59:54 +02:00
parent 772e82aa60
commit a972183286
3 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
DataBoards = ['hiddenThreads', 'hiddenPosts', 'lastReadPosts', 'yourPosts', 'watchedThreads']
class DataBoard
@keys = ['hiddenThreads', 'hiddenPosts', 'lastReadPosts', 'yourPosts', 'watchedThreads']
constructor: (@key, sync, dontClean) ->
@data = Conf[key]
$.sync key, @onSync

View File

@ -26,7 +26,7 @@ Main =
Conf[parent] = obj
return
flatten null, Config
for db in DataBoards
for db in DataBoard.keys
Conf[db] = boards: {}
Conf['selectedArchives'] = {}
Conf['archives'] = Redirect.archives

View File

@ -169,7 +169,7 @@ Settings =
data =
version: g.VERSION
date: now
for db in DataBoards
for db in DataBoard.keys
Conf[db] = boards: {}
# Make sure to export the most recent data.
$.get Conf, (Conf) ->