diff options
author | Kristóf Marussy <kristof@marussy.com> | 2022-04-23 01:59:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-22 23:59:21 +0000 |
commit | d02644f7c41150709795e57bfd40351b4da35a7b (patch) | |
tree | 2403fb76bd5fae1703f8b55172ffce9e0a5d2bce /src/internal-server/app/Controllers/Http | |
parent | Complete tray icons redesign for all platforms (#28) (diff) | |
download | ferdium-app-d02644f7c41150709795e57bfd40351b4da35a7b.tar.gz ferdium-app-d02644f7c41150709795e57bfd40351b4da35a7b.tar.zst ferdium-app-d02644f7c41150709795e57bfd40351b4da35a7b.zip |
Preload safe debug shim (#29)
In https://github.com/ferdium/ferdium-app/pull/23 we removed usages of
the debug package due to an electron bug.
This patch aims to restore some debug functionality by introducing a
shim. The shim detect whether if it is being introduced in a preload
script where the electron but would be triggered, and falls back to a
simple replacement for debug. However, in the main and renderer
processes, where a preload script is not being used, we still get full
debug functionality.
In this way, a module can be used both in a preload script and outside
of it, while still preserving debug functionality whenever possible.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
Diffstat (limited to 'src/internal-server/app/Controllers/Http')
-rw-r--r-- | src/internal-server/app/Controllers/Http/RecipeController.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/internal-server/app/Controllers/Http/RecipeController.js b/src/internal-server/app/Controllers/Http/RecipeController.js index 474ffadb4..5f7c32d70 100644 --- a/src/internal-server/app/Controllers/Http/RecipeController.js +++ b/src/internal-server/app/Controllers/Http/RecipeController.js | |||
@@ -4,7 +4,7 @@ const { validateAll } = use('Validator'); | |||
4 | const Env = use('Env'); | 4 | const Env = use('Env'); |
5 | 5 | ||
6 | const fetch = require('node-fetch'); | 6 | const fetch = require('node-fetch'); |
7 | const debug = require('debug')('Ferdium:internalServer:RecipeController'); | 7 | const debug = require('../../../../preload-safe-debug')('Ferdium:internalServer:RecipeController'); |
8 | const { LIVE_FERDIUM_API } = require('../../../../config'); | 8 | const { LIVE_FERDIUM_API } = require('../../../../config'); |
9 | const { API_VERSION } = require('../../../../environment-remote'); | 9 | const { API_VERSION } = require('../../../../environment-remote'); |
10 | 10 | ||