diff --git a/src/boot/after_store.js b/src/boot/after_store.js index f5e84cbc67808cd946bd7f4eeaffa548ef2ce0dd..f5add8ade5d93419946fc139ef288fe875b85500 100644 --- a/src/boot/after_store.js +++ b/src/boot/after_store.js @@ -241,7 +241,7 @@ const afterStoreSetup = async ({ store, i18n }) => { // Now we have the server settings and can try logging in if (store.state.oauth.token) { - store.dispatch('loginUser', store.state.oauth.token) + await store.dispatch('loginUser', store.state.oauth.token) } const router = new VueRouter({ diff --git a/src/components/registration/registration.js b/src/components/registration/registration.js index ab6cd64d9e7a0625d715b1b139c857c8fc4aa9b7..8dc0042087a321f3cf0d7672fac075f29237bf54 100644 --- a/src/components/registration/registration.js +++ b/src/components/registration/registration.js @@ -35,6 +35,9 @@ const registration = { }, computed: { token () { return this.$route.params.token }, + bioPlaceholder () { + return this.$t('registration.bio_placeholder').replace(/\s*\n\s*/g, ' \n') + }, ...mapState({ registrationOpen: (state) => state.instance.registrationOpen, signedIn: (state) => !!state.users.currentUser, diff --git a/src/components/registration/registration.vue b/src/components/registration/registration.vue index e22b308df01d2ef9eefc2a937d8641c544fea4b9..110b27bfcadfbb63fb6175ab5f79d37ed0635ed9 100644 --- a/src/components/registration/registration.vue +++ b/src/components/registration/registration.vue @@ -45,7 +45,7 @@ <div class='form-group'> <label class='form--label' for='bio'>{{$t('registration.bio')}} ({{$t('general.optional')}})</label> - <textarea :disabled="isPending" v-model='user.bio' class='form-control' id='bio' :placeholder="$t('registration.bio_placeholder')"></textarea> + <textarea :disabled="isPending" v-model='user.bio' class='form-control' id='bio' :placeholder="bioPlaceholder"></textarea> </div> <div class='form-group' :class="{ 'form-group--error': $v.user.password.$error }"> diff --git a/src/i18n/en.json b/src/i18n/en.json index ecf9628f3a670518111fc2f822bdb28a38ccfee2..c501c6a79b00f370c0c21164be05d2b5920b2c3d 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -98,7 +98,7 @@ "new_captcha": "Click the image to get a new captcha", "username_placeholder": "e.g. lain", "fullname_placeholder": "e.g. Lain Iwakura", - "bio_placeholder": "e.g.\nHi, I'm Lain\nI’m an anime girl living in suburban Japan. You may know me from the Wired.", + "bio_placeholder": "e.g.\nHi, I'm Lain.\nI’m an anime girl living in suburban Japan. You may know me from the Wired.", "validations": { "username_required": "cannot be left blank", "fullname_required": "cannot be left blank", diff --git a/src/lib/persisted_state.js b/src/lib/persisted_state.js index 720ff706a3a354c7e135e7898f503d6e02976c67..7ab89c12350d20f1c19159825ad266fcaff3c456 100644 --- a/src/lib/persisted_state.js +++ b/src/lib/persisted_state.js @@ -60,9 +60,6 @@ export default function createPersistedState ({ merge({}, store.state, savedState) ) } - if (store.state.oauth.token) { - store.dispatch('loginUser', store.state.oauth.token) - } loaded = true } catch (e) { console.log("Couldn't load state") diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index 065a67abb455977e98c3d29040f9a8aa10303a6a..c2949a040b1fdfc54e3901a06fce5b753e38f11c 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -1,9 +1,6 @@ /* eslint-env browser */ const LOGIN_URL = '/api/account/verify_credentials.json' -const FRIENDS_TIMELINE_URL = '/api/statuses/friends_timeline.json' const ALL_FOLLOWING_URL = '/api/qvitter/allfollowing' -const PUBLIC_TIMELINE_URL = '/api/statuses/public_timeline.json' -const PUBLIC_AND_EXTERNAL_TIMELINE_URL = '/api/statuses/public_and_external_timeline.json' const TAG_TIMELINE_URL = '/api/statusnet/tags/timeline' const FAVORITE_URL = '/api/favorites/create' const UNFAVORITE_URL = '/api/favorites/destroy' @@ -33,6 +30,8 @@ const SUGGESTIONS_URL = '/api/v1/suggestions' const MASTODON_USER_FAVORITES_TIMELINE_URL = '/api/v1/favourites' const MASTODON_DIRECT_MESSAGES_TIMELINE_URL = '/api/v1/timelines/direct' +const MASTODON_PUBLIC_TIMELINE = '/api/v1/timelines/public' +const MASTODON_USER_HOME_TIMELINE_URL = '/api/v1/timelines/home' const MASTODON_STATUS_URL = id => `/api/v1/statuses/${id}` const MASTODON_STATUS_CONTEXT_URL = id => `/api/v1/statuses/${id}/context` const MASTODON_USER_URL = '/api/v1/accounts' @@ -347,12 +346,12 @@ const fetchStatus = ({id, credentials}) => { const fetchTimeline = ({timeline, credentials, since = false, until = false, userId = false, tag = false, withMuted = false}) => { const timelineUrls = { - public: PUBLIC_TIMELINE_URL, - friends: FRIENDS_TIMELINE_URL, + public: MASTODON_PUBLIC_TIMELINE, + friends: MASTODON_USER_HOME_TIMELINE_URL, mentions: MENTIONS_URL, dms: MASTODON_DIRECT_MESSAGES_TIMELINE_URL, notifications: QVITTER_USER_NOTIFICATIONS_URL, - 'publicAndExternal': PUBLIC_AND_EXTERNAL_TIMELINE_URL, + 'publicAndExternal': MASTODON_PUBLIC_TIMELINE, user: MASTODON_USER_TIMELINE_URL, media: MASTODON_USER_TIMELINE_URL, favorites: MASTODON_USER_FAVORITES_TIMELINE_URL, @@ -379,6 +378,12 @@ const fetchTimeline = ({timeline, credentials, since = false, until = false, use if (timeline === 'media') { params.push(['only_media', 1]) } + if (timeline === 'public') { + params.push(['local', true]) + } + if (timeline === 'public' || timeline === 'publicAndExternal') { + params.push(['only_media', false]) + } params.push(['count', 20]) params.push(['with_muted', withMuted])