refactor: ♻️ Make auth store require less null checks

This commit is contained in:
Jesse Wierzbinski 2026-01-09 22:35:46 +01:00
parent 68e23a818a
commit b23ed66401
No known key found for this signature in database
32 changed files with 111 additions and 124 deletions

View file

@ -41,7 +41,7 @@ export const calculateMentionsFromReply = (
// Deduplicate mentions
.filter((men, i, a) => a.indexOf(men) === i)
// Remove self
.filter((men) => men.id !== authStore.identity?.account.id);
.filter((men) => men.id !== authStore.identity.account.id);
if (peopleToMention.length === 0) {
return "";
@ -72,8 +72,8 @@ export const useComposerStore = (key: ComposerStateKey) =>
isOverCharacterLimit(): boolean {
const authStore = useAuthStore();
const characterLimit =
authStore.identity?.instance.configuration.statuses
.max_characters ?? 0;
authStore.identity.instance.configuration.statuses
.max_characters;
return this.characterCount > characterLimit;
},