From 168590951a6833e48d7fc3db9947e174e0eb508c Mon Sep 17 00:00:00 2001 From: brewmanandi Date: Tue, 7 Sep 2021 18:58:33 +0200 Subject: [PATCH] Prepare the nudging message for PS plugins < 2.*.* (#2) * - added nudging message for old CEP PS plugin * Update requirements.in * Update requirements.in * Update requirements.in Co-authored-by: Andreas Braumann Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Alexander Graf --- api/src/index.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/api/src/index.js b/api/src/index.js index d518a716..933d5584 100644 --- a/api/src/index.js +++ b/api/src/index.js @@ -1,13 +1,12 @@ const logger = require("kaleido-api/logger"); +require("dotenv").config() if(process.env.NODE_ENV == "development") { - require("dotenv").config() - const mockery = require("mockery") mockery.enable({ warnOnUnregistered: false }) - mockery.registerSubstitute("kaleido-api/core", "mock/core_mock") + mockery.registerSubstitute("kaleido-api/core", "./mock/core_mock") } const https = require('https'); @@ -124,7 +123,11 @@ function startServer() { case "photoshop": // req.query.v == "1.0.0" // req.query.v == "1.0.1" - res.json({"status": "ok"}); + if (req.query.v.split('.')[0]=="1") { // send warning nudge to all users of CEP plugin + res.json({"status": "warning", "message": "⚠️ This plugin is outdated
Learn how to upgrade to the new version in the FAQ section. www.remove.bg/photoshop"}); + } else { + res.json({"status": "ok"}); + } break; case "desktop": // req.query.v == "1.0.0"