[feature] Re-enable auto-unfold CW setting (#46)
Fixes #45 Reviewed-on: https://codeberg.org/superseriousbusiness/masto-fe-standalone/pulls/46 Co-authored-by: prplecake <me@prplecake.com> Co-committed-by: prplecake <me@prplecake.com>
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { expandSpoilers } from 'flavours/glitch/initial_state';
|
||||
|
||||
function _autoUnfoldCW(spoiler_text, skip_unfold_regex) {
|
||||
if (!expandSpoilers)
|
||||
function _autoUnfoldCW(spoiler_text, settings) {
|
||||
if (!settings.getIn(['content_warnings', 'auto_unfold']))
|
||||
return false;
|
||||
|
||||
const skip_unfold_regex = settings.getIn(['content_warnings', 'filter']);
|
||||
|
||||
if (!skip_unfold_regex)
|
||||
return true;
|
||||
|
||||
@@ -20,12 +20,12 @@ function _autoUnfoldCW(spoiler_text, skip_unfold_regex) {
|
||||
}
|
||||
|
||||
export function autoHideCW(settings, spoiler_text) {
|
||||
return !_autoUnfoldCW(spoiler_text, settings.getIn(['content_warnings', 'filter']));
|
||||
return !_autoUnfoldCW(spoiler_text, settings);
|
||||
}
|
||||
|
||||
export function autoUnfoldCW(settings, status) {
|
||||
if (!status)
|
||||
return false;
|
||||
|
||||
return _autoUnfoldCW(status.get('spoiler_text'), settings.getIn(['content_warnings', 'filter']));
|
||||
return _autoUnfoldCW(status.get('spoiler_text'), settings);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user