Fix 'always expand CWs' option not applying on timeline views, resolves #179

This commit is contained in:
Laura Hausmann 2023-09-02 23:02:54 +02:00
parent 206e81da10
commit de3c75689e
No known key found for this signature in database
GPG key ID: D044E84C5BE01605
4 changed files with 7 additions and 6 deletions

View file

@ -346,7 +346,7 @@ let appearNote = $computed(() =>
isRenote ? (note.renote as misskey.entities.Note) : note, isRenote ? (note.renote as misskey.entities.Note) : note,
); );
const isMyRenote = $i && $i.id === note.userId; const isMyRenote = $i && $i.id === note.userId;
const showContent = ref(false); const showContent = ref(defaultStore.state.alwaysExpandCws);
const isDeleted = ref(false); const isDeleted = ref(false);
const muted = ref(getWordSoftMute(note, $i, defaultStore.state.mutedWords)); const muted = ref(getWordSoftMute(note, $i, defaultStore.state.mutedWords));
const translation = ref(null); const translation = ref(null);

View file

@ -224,7 +224,7 @@ const noteEl = $ref();
const menuButton = ref<HTMLElement>(); const menuButton = ref<HTMLElement>();
const renoteButton = ref<InstanceType<typeof XRenoteButton>>(); const renoteButton = ref<InstanceType<typeof XRenoteButton>>();
const reactButton = ref<HTMLElement>(); const reactButton = ref<HTMLElement>();
const showContent = ref(false); const showContent = ref(defaultStore.state.alwaysExpandCws);
const isDeleted = ref(false); const isDeleted = ref(false);
const muted = ref(getWordSoftMute(note, $i, defaultStore.state.mutedWords)); const muted = ref(getWordSoftMute(note, $i, defaultStore.state.mutedWords));
const translation = ref(null); const translation = ref(null);

View file

@ -249,16 +249,16 @@ const urls = props.note.text
: null; : null;
const cwStyle = computed (() => `_cw_style_${defaultStore.state.cwStyle}`); const cwStyle = computed (() => `_cw_style_${defaultStore.state.cwStyle}`);
let _showContent = $ref(null); let _showContent = $ref(defaultStore.state.alwaysExpandCws);
let showContent = $computed({ let showContent = $computed({
set(val) { _showContent = val }, set(val) { _showContent = val },
get() { get() {
if (props.forceExpandCw != null) { if (props.forceExpandCw != null && props.detailedView) {
_showContent = props.forceExpandCw; _showContent = props.forceExpandCw;
props.forceExpandCw = null; props.forceExpandCw = null;
} }
return _showContent || false; return _showContent;
}, },
}) })

View file

@ -414,7 +414,8 @@ watch(
advancedMfm, advancedMfm,
autoplayMfm, autoplayMfm,
expandOnNoteClick, expandOnNoteClick,
cwStyle cwStyle,
alwaysExpandCws
], ],
async () => { async () => {
await reloadAsk(); await reloadAsk();