mirror of
https://github.com/versia-pub/frontend.git
synced 2026-06-14 15:39:15 +02:00
refactor: ♻️ Make auth store require less null checks
This commit is contained in:
parent
68e23a818a
commit
b23ed66401
32 changed files with 111 additions and 124 deletions
|
|
@ -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;
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue