From 5ad84a700e295879d514eaf089392c5cbf2c51b1 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 14 Feb 2015 14:05:14 -0800 Subject: [PATCH] Reduce unnecessary storage writes. --- src/General/Index.coffee | 7 ++++--- src/General/lib/databoard.class | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/General/Index.coffee b/src/General/Index.coffee index 3e699913b..32927642c 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -321,9 +321,10 @@ Index = state saveMode: (mode) -> - Conf['Index Mode'] = mode - $.set 'Index Mode', mode - unless mode is 'catalog' + unless Conf['Index Mode'] is mode + Conf['Index Mode'] = mode + $.set 'Index Mode', mode + unless mode is 'catalog' or Conf['Previous Index Mode'] is mode Conf['Previous Index Mode'] = mode $.set 'Previous Index Mode', mode diff --git a/src/General/lib/databoard.class b/src/General/lib/databoard.class index 2e6a54615..3b4eccbae 100755 --- a/src/General/lib/databoard.class +++ b/src/General/lib/databoard.class @@ -79,7 +79,7 @@ class DataBoard for boardID of @data.boards for threadID of @data.boards[boardID] @ajaxClean boardID, threadID - @save() + return ajaxClean: (boardID, threadID) -> $.ajax "//a.4cdn.org/#{boardID}/thread/#{threadID}.json",