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
+39 -1
View File
@@ -5976,13 +5976,45 @@ speechSynthesis.getVoices();
} else { } else {
API.endpointDomain = API.endpointDomainVrchat; API.endpointDomain = API.endpointDomainVrchat;
} }
return new Promise((resolve, reject) => {
if (this.enablePrimaryPassword) { if (this.enablePrimaryPassword) {
this.checkPrimaryPassword(loginParmas)
.then((pwd) => {
this.loginForm.loading = true;
return API.getConfig()
.catch((err) => {
this.loginForm.loading = false;
reject(err);
})
.then(() => {
API.login({
username: loginParmas.username,
password: pwd,
cipher: loginParmas.password
})
.catch((err2) => {
this.loginForm.loading = false;
API.logout(); API.logout();
reject(err2);
})
.then(() => {
this.loginForm.loading = false;
resolve();
});
});
})
.catch((_) => {
this.$message({
message: 'Incorrect primary password',
type: 'error'
});
reject(_);
});
} else { } else {
API.getConfig() API.getConfig()
.catch((err) => { .catch((err) => {
this.loginForm.loading = false; this.loginForm.loading = false;
throw err; reject(err);
}) })
.then(() => { .then(() => {
API.login({ API.login({
@@ -5996,9 +6028,11 @@ speechSynthesis.getVoices();
}) })
.then(() => { .then(() => {
this.loginForm.loading = false; this.loginForm.loading = false;
resolve();
}); });
}); });
} }
});
}; };
$app.methods.deleteSavedLogin = function (username) { $app.methods.deleteSavedLogin = function (username) {
@@ -6024,6 +6058,9 @@ 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') {
if ($app.enablePrimaryPassword) {
this.logout();
} else {
$app.relogin(user).then(() => { $app.relogin(user).then(() => {
new Noty({ new Noty({
type: 'success', type: 'success',
@@ -6031,6 +6068,7 @@ speechSynthesis.getVoices();
}).show(); }).show();
}); });
} }
}
}); });
$app.data.loginForm = { $app.data.loginForm = {
+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
); );