bookstatus(fix): reset self.stats on init

This commit is contained in:
Qingping Hou
2016-04-05 21:43:20 -07:00
parent 2a2643bdb5
commit 7c46cb3eda

View File

@@ -50,15 +50,15 @@ local BookStatusWidget = InputContainer:new{
status = "",
modified = "",
},
stats = {
total_time_in_sec = 0,
performance_in_pages = {},
pages = 0,
}
stats = nil
}
function BookStatusWidget:init()
self.stats.pages = self.document:getPageCount()
self.stats = {
total_time_in_sec = 0,
performance_in_pages = {},
pages = self.document:getPageCount(),
}
self:getStatisticsSettings()
if self.settings then
self.summary = self.settings:readSetting("summary")