FIX: Use base 10 when gettings allowed group IDs from settings. (#113)
A missing parameter on the `parseInt` function was causing unexpected UI behavior for the AI helper since it turned an allowed group ID into NaN. We should always use base10 when parsing these IDs.
This commit is contained in:
parent
3f05d3a732
commit
79289ba231
|
@ -149,7 +149,7 @@ export default {
|
||||||
|
|
||||||
const aiBotsAllowedGroups = settings.ai_bot_allowed_groups
|
const aiBotsAllowedGroups = settings.ai_bot_allowed_groups
|
||||||
.split("|")
|
.split("|")
|
||||||
.map(parseInt);
|
.map((id) => parseInt(id, 10));
|
||||||
const canInteractWithAIBots = user?.groups.some((g) =>
|
const canInteractWithAIBots = user?.groups.some((g) =>
|
||||||
aiBotsAllowedGroups.includes(g.id)
|
aiBotsAllowedGroups.includes(g.id)
|
||||||
);
|
);
|
||||||
|
|
|
@ -60,7 +60,7 @@ export default {
|
||||||
|
|
||||||
const allowedGroups = settings.ai_helper_allowed_groups
|
const allowedGroups = settings.ai_helper_allowed_groups
|
||||||
.split("|")
|
.split("|")
|
||||||
.map(parseInt);
|
.map((id) => parseInt(id, 10));
|
||||||
const canUseAssistant = user?.groups.some((g) =>
|
const canUseAssistant = user?.groups.some((g) =>
|
||||||
allowedGroups.includes(g.id)
|
allowedGroups.includes(g.id)
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue