From bb9ca6e40fb45011f78bcc1c7ea51b2f1ceaf9f2 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Wed, 10 Feb 2021 18:48:13 +0100 Subject: [PATCH] Reorder HTML cache file --- nw/gui/build.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/nw/gui/build.py b/nw/gui/build.py index 2687ccde..3b76248f 100644 --- a/nw/gui/build.py +++ b/nw/gui/build.py @@ -1052,14 +1052,14 @@ class GuiBuildNovel(QDialog): nw.logException() return False - if "htmlText" in theData.keys(): - self.htmlText = theData["htmlText"] - dataCount += 1 + if "buildTime" in theData.keys(): + self.buildTime = theData["buildTime"] if "htmlStyle" in theData.keys(): self.htmlStyle = theData["htmlStyle"] dataCount += 1 - if "buildTime" in theData.keys(): - self.buildTime = theData["buildTime"] + if "htmlText" in theData.keys(): + self.htmlText = theData["htmlText"] + dataCount += 1 return dataCount == 2 @@ -1072,9 +1072,9 @@ class GuiBuildNovel(QDialog): try: with open(buildCache, mode="w+", encoding="utf8") as outFile: outFile.write(json.dumps({ - "htmlText" : self.htmlText, - "htmlStyle" : self.htmlStyle, "buildTime" : self.buildTime, + "htmlStyle" : self.htmlStyle, + "htmlText" : self.htmlText, }, indent=2)) except Exception: logger.error("Failed to save build cache")