From 80d3fcf12b3d7280a00969c12b53349a72a6077a Mon Sep 17 00:00:00 2001 From: Jonathan Lai Date: Tue, 24 Sep 2024 16:26:55 -0400 Subject: [PATCH 1/4] refactored code cognitive complexity from p1 --- src/meta/themes.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/meta/themes.js b/src/meta/themes.js index 6cce964832..7409e9982e 100644 --- a/src/meta/themes.js +++ b/src/meta/themes.js @@ -115,15 +115,19 @@ Themes.set = async (data) => { // Re-set the themes path (for when NodeBB is reloaded) Themes.setPath(config); + console.log('jonathan lai'); + await Meta.configs.setMultiple({ 'theme:type': data.type, 'theme:id': data.id, - 'theme:staticDir': config.staticDir ? config.staticDir : '', - 'theme:templates': config.templates ? config.templates : '', + 'theme:staticDir': config.staticDir || '', + 'theme:templates': config.templates || '', 'theme:src': '', bootswatchSkin: '', }); + console.log('jonathan lai'); + await events.log({ type: 'theme-set', uid: parseInt(data.uid, 10) || 0, From e3b5126ec72869db5942bad379d7a04c1c2d1bd7 Mon Sep 17 00:00:00 2001 From: Jonathan Lai Date: Tue, 24 Sep 2024 16:35:56 -0400 Subject: [PATCH 2/4] refactored code cognitive complexity from p1 --- src/meta/themes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/meta/themes.js b/src/meta/themes.js index 7409e9982e..19c4db73b9 100644 --- a/src/meta/themes.js +++ b/src/meta/themes.js @@ -125,7 +125,7 @@ Themes.set = async (data) => { 'theme:src': '', bootswatchSkin: '', }); - + console.log('jonathan lai'); await events.log({ From 08305ffca2e0ee6cedf11fac3a79b5641fec35b9 Mon Sep 17 00:00:00 2001 From: J0nathanLai <112527440+J0nathanLai@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:40:49 -0400 Subject: [PATCH 3/4] refactored code cognitive complexity from p1 --- src/meta/themes.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/meta/themes.js b/src/meta/themes.js index 19c4db73b9..f2fb978ee6 100644 --- a/src/meta/themes.js +++ b/src/meta/themes.js @@ -126,8 +126,6 @@ Themes.set = async (data) => { bootswatchSkin: '', }); - console.log('jonathan lai'); - await events.log({ type: 'theme-set', uid: parseInt(data.uid, 10) || 0, From 46cea072e4c65877debec742db0d0064a121a5b4 Mon Sep 17 00:00:00 2001 From: J0nathanLai <112527440+J0nathanLai@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:44:52 -0400 Subject: [PATCH 4/4] refactored code cognitive complexity from p1 --- src/meta/themes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/meta/themes.js b/src/meta/themes.js index f2fb978ee6..5113b916f2 100644 --- a/src/meta/themes.js +++ b/src/meta/themes.js @@ -125,7 +125,7 @@ Themes.set = async (data) => { 'theme:src': '', bootswatchSkin: '', }); - + await events.log({ type: 'theme-set', uid: parseInt(data.uid, 10) || 0,