refine push notification ui and catch promises

This commit is contained in:
keyan 2023-07-04 17:19:59 -05:00
parent 3068252adf
commit a17b4d1f1a
3 changed files with 9 additions and 3 deletions

View File

@ -951,7 +951,7 @@ export default {
body: updatedItem.title ? updatedItem.title : updatedItem.text,
data: { url: `/items/${updatedItem.id}` },
tag: `TIP-${updatedItem.id}`
})
}).catch(console.error)
return {
vote,
@ -1212,7 +1212,7 @@ export const createMentions = async (item, models) => {
body: item.text,
data: { url: `/items/${item.id}` },
tag: 'MENTION'
})
}).catch(console.error)
})
}
} catch (e) {

View File

@ -298,7 +298,9 @@ function NotificationAlert () {
: (
<Form className='d-flex justify-content-end' initial={{ pushNotify: hasSubscription }}>
<Checkbox
name='pushNotify' label='push notifications' inline checked={hasSubscription} handleChange={async () => {
name='pushNotify' label={<span className='text-muted'>push notifications</span>}
groupClassName={`${styles.subFormGroup} mb-1 mr-sm-3 mr-0`}
inline checked={hasSubscription} handleChange={async () => {
await sw.togglePushSubscription().catch(setError)
}}
/>

View File

@ -22,4 +22,8 @@
background-color: transparent;
border: 0 solid transparent;
font-size: 0.9rem;
}
.subFormGroup > div {
margin-right: 0 !important;
}