From 3fee3690b540ffd4316c53f7a7f70fe771a3c657 Mon Sep 17 00:00:00 2001 From: cha0s Date: Thu, 17 Dec 2020 00:18:36 -0600 Subject: [PATCH] fix: undefined req --- packages/state/src/index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/state/src/index.js b/packages/state/src/index.js index 6565739..b616a72 100644 --- a/packages/state/src/index.js +++ b/packages/state/src/index.js @@ -3,9 +3,12 @@ import {ensureUniqueReduction} from '@latus/core'; export default { hooks: { '@latus/http/plugins': async (req, latus) => ({ - '@reddichat/state/client': { - defaultState: await ensureUniqueReduction(latus, '@reddichat/state/defaultState', req), - }, + '@reddichat/state/client': req + ? { + defaultState: await ensureUniqueReduction(latus, '@reddichat/state/defaultState', req), + } + : {} + , }), }, };