2021-07-05 04:19:04 +01:00
|
|
|
import { store } from '../_store/store.js'
|
2018-03-03 23:44:43 +00:00
|
|
|
|
|
|
|
export function toggleContentWarningShown (realm) {
|
2019-08-03 21:49:37 +01:00
|
|
|
const shown = store.getComposeData(realm, 'contentWarningShown')
|
|
|
|
const contentWarning = store.getComposeData(realm, 'contentWarning')
|
|
|
|
const newShown = !shown
|
2018-03-29 02:37:53 +01:00
|
|
|
store.setComposeData(realm, {
|
2018-04-12 06:55:11 +01:00
|
|
|
contentWarning: newShown ? contentWarning : '',
|
2019-09-15 18:45:46 +01:00
|
|
|
contentWarningShown: newShown,
|
|
|
|
sensitive: contentWarning && newShown // toggling content warning automatically toggles sensitive media
|
2018-03-29 02:37:53 +01:00
|
|
|
})
|
2018-03-03 23:44:43 +00:00
|
|
|
}
|