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
c3d6e0e9
Unverified
Commit
c3d6e0e9
authored
Feb 17, 2020
by
Guilherme Gazzo
Browse files
Merge remote-tracking branch 'origin/develop'
* origin/develop: fix: actionId on action hooks (#149) v0.2.0 (#150)
parents
c200e8a0
c305eb21
Changes
1
Hide whitespace changes
Inline
Side-by-side
packages/fuselage-ui-kit/src/hooks.js
View file @
c3d6e0e9
...
...
@@ -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