From dbea9d8bb18b806d76bb3cbd3c752c3aedde9b40 Mon Sep 17 00:00:00 2001 From: OldHawk Date: Tue, 23 Jan 2018 10:29:28 +0800 Subject: [PATCH] fix(core): fixed home global sale notice css --- config/env/torrents.js | 2 +- .../server/controllers/announces.server.controller.js | 4 ++-- modules/core/client/controllers/home.client.controller.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/env/torrents.js b/config/env/torrents.js index 86a1d691..f254c9a7 100644 --- a/config/env/torrents.js +++ b/config/env/torrents.js @@ -843,7 +843,7 @@ module.exports = { */ torrentGlobalSales: { global: { - value: 'U2/FREE', + value: 'U3/FREE', startAt: '2018-01-29 00:00:00', expires: 60 * 60 * 1000 * 24 * 3, noticeMsg: 'SITE_NOTICE.GLOBAL_SALES_NOTICE', diff --git a/modules/announce/server/controllers/announces.server.controller.js b/modules/announce/server/controllers/announces.server.controller.js index fcd8c77b..5f6f6c4a 100644 --- a/modules/announce/server/controllers/announces.server.controller.js +++ b/modules/announce/server/controllers/announces.server.controller.js @@ -866,9 +866,9 @@ exports.announce = function (req, res) { var start = moment(globalSalesConfig.global.startAt, globalSalesConfig.global.timeFormats).utc().valueOf(); var end = start + globalSalesConfig.global.expires; var now = Date.now(); - isGlobalSaleValid = (now > start && now < end) ? true : false; + isGlobalSaleValid = (now > start && now < end && globalSalesConfig.global.value) ? true : false; - if (isGlobalSaleValid) { + if (isGlobalSaleValid && globalSalesConfig.global.value) { sale = globalSalesConfig.global.value; } diff --git a/modules/core/client/controllers/home.client.controller.js b/modules/core/client/controllers/home.client.controller.js index 26b36427..8ceb806c 100644 --- a/modules/core/client/controllers/home.client.controller.js +++ b/modules/core/client/controllers/home.client.controller.js @@ -44,7 +44,7 @@ var end = start + vm.globalSalesConfig.global.expires; var now = Date.now(); - if (now > showat && now < end) { + if (now > showat && now < end && vm.globalSalesConfig.global.value) { return true; } else { return false;