aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/login_form/login_form.js22
-rw-r--r--src/components/login_form/login_form.vue21
-rw-r--r--src/components/registration/registration.vue18
-rw-r--r--src/components/status/status.js2
-rw-r--r--src/components/user_profile/user_profile.vue4
5 files changed, 36 insertions, 31 deletions
diff --git a/src/components/login_form/login_form.js b/src/components/login_form/login_form.js
index 013222a8..fb6dc651 100644
--- a/src/components/login_form/login_form.js
+++ b/src/components/login_form/login_form.js
@@ -22,19 +22,29 @@ const LoginForm = {
oauth: this.$store.state.oauth,
instance: this.$store.state.instance.server
}
+ this.clearError()
oauthApi.getOrCreateApp(data).then((app) => {
oauthApi.getTokenWithCredentials(
{
app,
instance: data.instance,
username: this.user.username,
- password: this.user.password})
- .then((result) => {
- this.$store.commit('setToken', result.access_token)
- this.$store.dispatch('loginUser', result.access_token)
- this.$router.push({name: 'friends'})
- })
+ password: this.user.password
+ }
+ ).then((result) => {
+ if (result.error) {
+ this.authError = result.error
+ this.user.password = ''
+ return
+ }
+ this.$store.commit('setToken', result.access_token)
+ this.$store.dispatch('loginUser', result.access_token)
+ this.$router.push({name: 'friends'})
+ })
})
+ },
+ clearError () {
+ this.authError = false
}
}
}
diff --git a/src/components/login_form/login_form.vue b/src/components/login_form/login_form.vue
index 12971882..27a8e48a 100644
--- a/src/components/login_form/login_form.vue
+++ b/src/components/login_form/login_form.vue
@@ -33,6 +33,13 @@
</div>
</div>
</form>
+
+ <div v-if="authError" class='form-group'>
+ <div class='alert error'>
+ {{authError}}
+ <i class="button-icon icon-cancel" @click="clearError"></i>
+ </div>
+ </div>
</div>
</div>
</template>
@@ -48,10 +55,6 @@
width: 10em;
}
- .error {
- text-align: center;
- }
-
.register {
flex: 1 1;
}
@@ -64,4 +67,14 @@
justify-content: space-between;
}
}
+
+.login {
+ .error {
+ text-align: center;
+
+ animation-name: shakeError;
+ animation-duration: 0.4s;
+ animation-timing-function: ease-in-out;
+ }
+}
</style>
diff --git a/src/components/registration/registration.vue b/src/components/registration/registration.vue
index 25c1a9d0..cf9bf5d9 100644
--- a/src/components/registration/registration.vue
+++ b/src/components/registration/registration.vue
@@ -147,24 +147,6 @@ $validations-cRed: #f04124;
margin-bottom: 1em;
}
- @keyframes shakeError {
- 0% {
- transform: translateX(0); }
- 15% {
- transform: translateX(0.375rem); }
- 30% {
- transform: translateX(-0.375rem); }
- 45% {
- transform: translateX(0.375rem); }
- 60% {
- transform: translateX(-0.375rem); }
- 75% {
- transform: translateX(0.375rem); }
- 90% {
- transform: translateX(-0.375rem); }
- 100% {
- transform: translateX(0); } }
-
.form-group--error {
animation-name: shakeError;
animation-duration: .6s;
diff --git a/src/components/status/status.js b/src/components/status/status.js
index b14a74ec..13e79dd0 100644
--- a/src/components/status/status.js
+++ b/src/components/status/status.js
@@ -125,7 +125,7 @@ const Status = {
return lengthScore > 20
},
isReply () {
- return !!this.status.in_reply_to_status_id
+ return !!(this.status.in_reply_to_status_id && this.status.in_reply_to_user_id)
},
replyToName () {
const user = this.$store.state.users.usersObject[this.status.in_reply_to_user_id]
diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue
index 74cd9c53..f9b964ce 100644
--- a/src/components/user_profile/user_profile.vue
+++ b/src/components/user_profile/user_profile.vue
@@ -20,8 +20,8 @@
<i class="icon-spin3 animate-spin"></i>
</div>
</div>
- <Timeline :label="$t('user_card.media')" :embedded="true" :title="$t('user_profile.media_title')" timeline-name="media" :timeline="media" :user-id="fetchBy" />
- <Timeline v-if="isUs" :label="$t('user_card.favorites')" :embedded="true" :title="$t('user_profile.favorites_title')" timeline-name="favorites" :timeline="favorites"/>
+ <Timeline :label="$t('user_card.media')" :embedded="true" :title="$t('user_card.media')" timeline-name="media" :timeline="media" :user-id="fetchBy" />
+ <Timeline v-if="isUs" :label="$t('user_card.favorites')" :embedded="true" :title="$t('user_card.favorites')" timeline-name="favorites" :timeline="favorites"/>
</tab-switcher>
</div>
<div v-else class="panel user-profile-placeholder">