refine push notification ui and catch promises
This commit is contained in:
parent
3068252adf
commit
a17b4d1f1a
@ -951,7 +951,7 @@ export default {
|
|||||||
body: updatedItem.title ? updatedItem.title : updatedItem.text,
|
body: updatedItem.title ? updatedItem.title : updatedItem.text,
|
||||||
data: { url: `/items/${updatedItem.id}` },
|
data: { url: `/items/${updatedItem.id}` },
|
||||||
tag: `TIP-${updatedItem.id}`
|
tag: `TIP-${updatedItem.id}`
|
||||||
})
|
}).catch(console.error)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
vote,
|
vote,
|
||||||
@ -1212,7 +1212,7 @@ export const createMentions = async (item, models) => {
|
|||||||
body: item.text,
|
body: item.text,
|
||||||
data: { url: `/items/${item.id}` },
|
data: { url: `/items/${item.id}` },
|
||||||
tag: 'MENTION'
|
tag: 'MENTION'
|
||||||
})
|
}).catch(console.error)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -298,7 +298,9 @@ function NotificationAlert () {
|
|||||||
: (
|
: (
|
||||||
<Form className='d-flex justify-content-end' initial={{ pushNotify: hasSubscription }}>
|
<Form className='d-flex justify-content-end' initial={{ pushNotify: hasSubscription }}>
|
||||||
<Checkbox
|
<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)
|
await sw.togglePushSubscription().catch(setError)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
@ -23,3 +23,7 @@
|
|||||||
border: 0 solid transparent;
|
border: 0 solid transparent;
|
||||||
font-size: 0.9rem;
|
font-size: 0.9rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.subFormGroup > div {
|
||||||
|
margin-right: 0 !important;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user