Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
RocketChat
Rocket.Chat.Fuselage
Commits
c305eb21
Unverified
Commit
c305eb21
authored
Feb 17, 2020
by
Guilherme Gazzo
Committed by
GitHub
Feb 17, 2020
Browse files
fix: actionId on action hooks (#149)
parent
fe913dc4
Changes
1
Hide whitespace changes
Inline
Side-by-side
packages/fuselage-ui-kit/src/hooks.js
View file @
c305eb21
...
...
@@ -24,12 +24,12 @@ export const useBlockContext = ({ blockId, actionId, appId, initialValue }, cont
setLoading
(
true
);
await
action
({
blockId
,
appId
:
appId
||
appIdFromContext
,
actionId
,
value
,
viewId
});
setLoading
(
false
);
},
[]);
},
[
actionId
,
blockId
]);
const
stateFunction
=
useCallback
(
async
({
target
:
{
value
}
})
=>
{
setValue
(
value
);
await
state
({
blockId
,
appId
,
actionId
,
value
});
},
[]);
},
[
actionId
,
blockId
]);
if
([
BLOCK_CONTEXT
.
SECTION
,
BLOCK_CONTEXT
.
ACTION
].
includes
(
context
))
{
return
[{
loading
,
setLoading
,
error
},
actionFunction
];
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment