Pinafore-Web-Client-Frontend/src/routes/_actions/contentWarnings.js

12 lines
382 B
JavaScript
Raw Normal View History

2018-03-04 00:44:43 +01:00
import { store } from '../_store/store'
export function toggleContentWarningShown (realm) {
2019-08-03 22:49:37 +02:00
const shown = store.getComposeData(realm, 'contentWarningShown')
const contentWarning = store.getComposeData(realm, 'contentWarning')
const newShown = !shown
store.setComposeData(realm, {
contentWarning: newShown ? contentWarning : '',
contentWarningShown: newShown
})
2018-03-04 00:44:43 +01:00
}