Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Commit

Permalink
add: expand all long notes option
Browse files Browse the repository at this point in the history
  • Loading branch information
Mar0xy committed Dec 3, 2023
1 parent 304a91a commit e566791
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkNote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ const urls = $computed(() => parsed ? extractUrlFromMfm(parsed).filter(u => u !=
const animated = $computed(() => parsed ? checkAnimationFromMfm(parsed) : null);
const allowAnim = ref(defaultStore.state.advancedMfm && defaultStore.state.animatedMfm ? true : false);
const isLong = shouldCollapsed(appearNote, urls ?? []);
const collapsed = ref(appearNote.cw == null && isLong);
const collapsed = defaultStore.state.expandLongNote && appearNote.cw == null ? false : ref(appearNote.cw == null && isLong);
const isDeleted = ref(false);
const renoted = ref(false);
const muted = ref($i ? checkWordMute(appearNote, $i, $i.mutedWords) : false);
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkSubNoteContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const parsed = $computed(() => props.note.text ? mfm.parse(props.note.text) : nu
const animated = $computed(() => parsed ? checkAnimationFromMfm(parsed) : null);
let allowAnim = $ref(defaultStore.state.advancedMfm && defaultStore.state.animatedMfm ? true : false);

const isLong = shouldCollapsed(props.note, []);
const isLong = defaultStore.state.expandLongNote && !props.hideFiles ? false : shouldCollapsed(props.note, []);

function animatedMFM() {
if (allowAnim) {
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/SkNote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ const urls = $computed(() => parsed ? extractUrlFromMfm(parsed).filter(u => u !=
const animated = $computed(() => parsed ? checkAnimationFromMfm(parsed) : null);
const allowAnim = ref(defaultStore.state.advancedMfm && defaultStore.state.animatedMfm ? true : false);
const isLong = shouldCollapsed(appearNote, urls ?? []);
const collapsed = ref(appearNote.cw == null && isLong);
const collapsed = defaultStore.state.expandLongNote && appearNote.cw == null ? false : ref(appearNote.cw == null && isLong);
const isDeleted = ref(false);
const renoted = ref(false);
const muted = ref($i ? checkWordMute(appearNote, $i, $i.mutedWords) : false);
Expand Down
4 changes: 4 additions & 0 deletions packages/frontend/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ export const defaultStore = markRaw(new Storage('base', {
where: 'account',
default: false,
},
expandLongNote: {
where: 'device',
default: false,
},
rememberNoteVisibility: {
where: 'account',
default: false,
Expand Down

0 comments on commit e566791

Please sign in to comment.