Add user actions to web app
This commit is contained in:
parent
12d347976c
commit
26ebd23bfd
13 changed files with 126 additions and 18 deletions
|
@ -105,6 +105,18 @@ export const encodeBase64Url = (s) => {
|
|||
return Base64.encodeURI(s);
|
||||
}
|
||||
|
||||
export const maybeAppendActionErrors = (message, notification) => {
|
||||
const actionErrors = (notification.actions ?? [])
|
||||
.map(action => action.error)
|
||||
.filter(action => !!action)
|
||||
.join("\n")
|
||||
if (actionErrors.length === 0) {
|
||||
return message;
|
||||
} else {
|
||||
return `${message}\n\n${actionErrors}`;
|
||||
}
|
||||
}
|
||||
|
||||
export const shuffle = (arr) => {
|
||||
let j, x;
|
||||
for (let index = arr.length - 1; index > 0; index--) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue