Bug fixes

This commit is contained in:
Natsumi
2022-02-13 19:07:35 +13:00
parent bf365ff63c
commit c680e4c0b8
2 changed files with 69 additions and 26 deletions
+60 -22
View File
@@ -5976,16 +5976,48 @@ speechSynthesis.getVoices();
} else { } else {
API.endpointDomain = API.endpointDomainVrchat; API.endpointDomain = API.endpointDomainVrchat;
} }
if (this.enablePrimaryPassword) { return new Promise((resolve, reject) => {
API.logout(); if (this.enablePrimaryPassword) {
} else { this.checkPrimaryPassword(loginParmas)
API.getConfig() .then((pwd) => {
.catch((err) => { this.loginForm.loading = true;
this.loginForm.loading = false; return API.getConfig()
throw err; .catch((err) => {
}) this.loginForm.loading = false;
.then(() => { reject(err);
API.login({ })
.then(() => {
API.login({
username: loginParmas.username,
password: pwd,
cipher: loginParmas.password
})
.catch((err2) => {
this.loginForm.loading = false;
API.logout();
reject(err2);
})
.then(() => {
this.loginForm.loading = false;
resolve();
});
});
})
.catch((_) => {
this.$message({
message: 'Incorrect primary password',
type: 'error'
});
reject(_);
});
} else {
API.getConfig()
.catch((err) => {
this.loginForm.loading = false;
reject(err);
})
.then(() => {
API.login({
username: loginParmas.username, username: loginParmas.username,
password: loginParmas.password, password: loginParmas.password,
endpoint: loginParmas.endpoint endpoint: loginParmas.endpoint
@@ -5993,12 +6025,14 @@ speechSynthesis.getVoices();
.catch(() => { .catch(() => {
this.loginForm.loading = false; this.loginForm.loading = false;
API.logout(); API.logout();
}) })
.then(() => { .then(() => {
this.loginForm.loading = false; this.loginForm.loading = false;
}); resolve();
}); });
} });
}
});
}; };
$app.methods.deleteSavedLogin = function (username) { $app.methods.deleteSavedLogin = function (username) {
@@ -6024,12 +6058,16 @@ speechSynthesis.getVoices();
var user = var user =
$app.loginForm.savedCredentials[$app.loginForm.lastUserLoggedIn]; $app.loginForm.savedCredentials[$app.loginForm.lastUserLoggedIn];
if (typeof user !== 'undefined') { if (typeof user !== 'undefined') {
$app.relogin(user).then(() => { if ($app.enablePrimaryPassword) {
new Noty({ this.logout();
type: 'success', } else {
text: 'Automatically logged in.' $app.relogin(user).then(() => {
}).show(); new Noty({
}); type: 'success',
text: 'Automatically logged in.'
}).show();
});
}
} }
}); });
+9 -4
View File
@@ -77,7 +77,7 @@ Vue.component('marquee-text', MarqueeText);
Vue.component('location', { Vue.component('location', {
template: template:
'<span>{{ text }}<slot></slot><span class="famfamfam-flags" :class="region" style="display:inline-block;margin-left:5px"></span></span>', '<span>{{ text }}<slot></slot><span class="famfamfam-flags" :class="region" style="display:inline-block;margin-left:5px"></span><i v-if="strict" class="el-icon el-icon-lock" style="display:inline-block;margin-left:5px"></i></span>',
props: { props: {
location: String, location: String,
hint: { hint: {
@@ -88,7 +88,8 @@ Vue.component('marquee-text', MarqueeText);
data() { data() {
return { return {
text: this.location, text: this.location,
region: this.region region: this.region,
strict: this.strict
}; };
}, },
methods: { methods: {
@@ -129,6 +130,7 @@ Vue.component('marquee-text', MarqueeText);
this.region = 'flag-icon-usw'; this.region = 'flag-icon-usw';
} }
} }
this.strict = L.strict;
} }
}, },
watch: { watch: {
@@ -216,7 +218,8 @@ Vue.component('marquee-text', MarqueeText);
hiddenId: null, hiddenId: null,
privateId: null, privateId: null,
friendsId: null, friendsId: null,
canRequestInvite: false canRequestInvite: false,
strict: false
}; };
if (_tag === 'offline') { if (_tag === 'offline') {
ctx.isOffline = true; ctx.isOffline = true;
@@ -243,6 +246,8 @@ Vue.component('marquee-text', MarqueeText);
ctx.canRequestInvite = true; ctx.canRequestInvite = true;
} else if (key === 'region') { } else if (key === 'region') {
ctx.region = value; ctx.region = value;
} else if (key === 'strict') {
ctx.strict = true;
} }
} else { } else {
ctx.instanceName = s; ctx.instanceName = s;
@@ -346,7 +351,7 @@ Vue.component('marquee-text', MarqueeText);
} else { } else {
this.lastLocationTimer = ''; this.lastLocationTimer = '';
} }
if (this.lastLocation.onlineForTimer !== 0) { if (this.lastLocation.onlineForTimer) {
this.onlineForTimer = timeToText( this.onlineForTimer = timeToText(
Date.now() - this.lastLocation.onlineFor Date.now() - this.lastLocation.onlineFor
); );