From ae09e162f97f7b0b2f94cc2083095877bc17fc4b Mon Sep 17 00:00:00 2001 From: ccd0 Date: Mon, 13 Jun 2016 02:39:54 -0700 Subject: [PATCH] Remove disabled option in archive settings. #904 --- src/Archive/Redirect.coffee | 20 ++++++++------------ src/General/Settings.coffee | 20 +++++++------------- 2 files changed, 15 insertions(+), 25 deletions(-) diff --git a/src/Archive/Redirect.coffee b/src/Archive/Redirect.coffee index ee54e8074..59efb05b4 100644 --- a/src/Archive/Redirect.coffee +++ b/src/Archive/Redirect.coffee @@ -22,23 +22,19 @@ Redirect = for data in Conf['archives'] for key in ['boards', 'files'] data[key] = [] unless data[key] instanceof Array - {uid, name, boards, files, software, withCredentials} = data + {uid, name, boards, files, software} = data continue unless software in ['fuuka', 'foolfuuka'] archives[JSON.stringify(uid ? name)] = data for boardID in boards - unless withCredentials - o.thread[boardID] = data unless boardID of o.thread - o.post[boardID] = data unless boardID of o.post or software isnt 'foolfuuka' - o.file[boardID] = data unless boardID of o.file or boardID not in files - o.report[boardID] = data if name is 'fgts' + o.thread[boardID] = data unless boardID of o.thread + o.post[boardID] = data unless boardID of o.post or software isnt 'foolfuuka' + o.file[boardID] = data unless boardID of o.file or boardID not in files + o.report[boardID] = data if name is 'fgts' for boardID, record of Conf['selectedArchives'] - for type, id of record - if id is null - delete o[type][boardID] - else if archive = archives[JSON.stringify id] - boards = if type is 'file' then archive.files else archive.boards - o[type][boardID] = archive if boardID in boards + for type, id of record when (archive = archives[JSON.stringify id]) + boards = if type is 'file' then archive.files else archive.boards + o[type][boardID] = archive if boardID in boards Redirect.data = o diff --git a/src/General/Settings.coffee b/src/General/Settings.coffee index 0d3cf5ab1..45919cf79 100644 --- a/src/General/Settings.coffee +++ b/src/General/Settings.coffee @@ -499,23 +499,17 @@ Settings = $.rmAll tbody archBoards = {} - for {uid, name, boards, files, software, withCredentials} in Conf['archives'] + for {uid, name, boards, files, software} in Conf['archives'] continue unless software in ['fuuka', 'foolfuuka'] for boardID in boards o = archBoards[boardID] or= - thread: [[], []] - post: [[], []] - file: [[], []] - i = +!!withCredentials + thread: [] + post: [] + file: [] archive = [uid ? name, name] - o.thread[i].push archive - o.post[i].push archive if software is 'foolfuuka' - o.file[i].push archive if boardID in files - for boardID, o of archBoards - for item in ['thread', 'post', 'file'] - i = if o[item][0].length then 1 else 0 - o[item][i].push [null, 'disabled'] - o[item] = o[item][0].concat(o[item][1]) + o.thread.push archive + o.post.push archive if software is 'foolfuuka' + o.file.push archive if boardID in files rows = [] boardOptions = []