From ea47ebc50f4040e4f104c3f7fec4b7ae66efbf55 Mon Sep 17 00:00:00 2001
From: AkiraFukushima
Date: Sat, 13 Aug 2022 01:32:45 +0900
Subject: [PATCH] refs #3182 Read max_characters from mastodon new API
regarding status configuration
---
.stylelintrc.json | 7 +++++++
src/renderer/components/Authorize.vue | 20 +++++++++++++++++---
src/renderer/components/Login/LoginForm.vue | 4 ++++
src/renderer/store/TimelineSpace.ts | 7 ++++++-
4 files changed, 34 insertions(+), 4 deletions(-)
diff --git a/.stylelintrc.json b/.stylelintrc.json
index 263fbd63..86751515 100644
--- a/.stylelintrc.json
+++ b/.stylelintrc.json
@@ -5,6 +5,13 @@
"stylelint-config-prettier"
],
"rules": {
+ "selector-pseudo-class-no-unknown": [
+ true,
+ {
+ "ignorePseudoClasses": ["deep"]
+ }
+ ],
+ "selector-class-pattern": "^(([a-z][a-zA-Z0-9_]+)|([a-z][a-z0-9]*)(-[a-zA-Z0-9_]+)*)$"
},
"overrides": [
{
diff --git a/src/renderer/components/Authorize.vue b/src/renderer/components/Authorize.vue
index b71fdca6..9539b4c8 100644
--- a/src/renderer/components/Authorize.vue
+++ b/src/renderer/components/Authorize.vue
@@ -33,7 +33,13 @@
-
+
{{ $t('authorize.submit') }}
@@ -125,7 +131,7 @@ export default defineComponent({
diff --git a/src/renderer/store/TimelineSpace.ts b/src/renderer/store/TimelineSpace.ts
index b37dabdf..e147f068 100644
--- a/src/renderer/store/TimelineSpace.ts
+++ b/src/renderer/store/TimelineSpace.ts
@@ -241,7 +241,12 @@ const actions: ActionTree = {
[ACTION_TYPES.FETCH_INSTANCE]: async ({ commit, state }, account: LocalAccount) => {
const client = generator(state.sns, account.baseURL, null, 'Whalebird')
const res = await client.getInstance()
- commit(MUTATION_TYPES.UPDATE_TOOT_MAX, res.data.max_toot_chars)
+ if (res.data.max_toot_chars) {
+ commit(MUTATION_TYPES.UPDATE_TOOT_MAX, res.data.max_toot_chars)
+ }
+ if (res.data.configuration) {
+ commit(MUTATION_TYPES.UPDATE_TOOT_MAX, res.data.configuration.statuses.max_characters)
+ }
return true
},
[ACTION_TYPES.LOAD_TIMELINE_SETTING]: async ({ commit }, accountID: string) => {