mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 06:56:04 +02:00
Use extractFileId function
This commit is contained in:
+14
-9
@@ -9230,9 +9230,7 @@ speechSynthesis.getVoices();
|
|||||||
|
|
||||||
$app.methods.compareCurrentVRCPlusIcon = function (userIcon) {
|
$app.methods.compareCurrentVRCPlusIcon = function (userIcon) {
|
||||||
try {
|
try {
|
||||||
var url = new URL(API.currentUser.userIcon);
|
var currentUserIcon = extractFileId(API.currentUser.userIcon);
|
||||||
var pathArray = url.pathname.split('/');
|
|
||||||
var currentUserIcon = pathArray[4];
|
|
||||||
if (userIcon === currentUserIcon) {
|
if (userIcon === currentUserIcon) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -10167,9 +10165,15 @@ speechSynthesis.getVoices();
|
|||||||
var signatureSizeInBytes = await $app.genLength(base64SignatureFile);
|
var signatureSizeInBytes = await $app.genLength(base64SignatureFile);
|
||||||
var avatarId = $app.avatarDialog.id;
|
var avatarId = $app.avatarDialog.id;
|
||||||
var { imageUrl } = $app.avatarDialog.ref;
|
var { imageUrl } = $app.avatarDialog.ref;
|
||||||
var url = new URL(imageUrl);
|
var fileId = extractFileId(imageUrl);
|
||||||
var pathArray = url.pathname.split('/');
|
if (!fileId) {
|
||||||
var fileId = pathArray[4];
|
$app.$message({
|
||||||
|
message: 'Current avatar image invalid',
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
|
clearFile();
|
||||||
|
return;
|
||||||
|
}
|
||||||
$app.avatarImage = {
|
$app.avatarImage = {
|
||||||
base64File,
|
base64File,
|
||||||
fileMd5,
|
fileMd5,
|
||||||
@@ -10449,9 +10453,10 @@ speechSynthesis.getVoices();
|
|||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var url = new URL(imageUrl);
|
var fileId = extractFileId(imageUrl);
|
||||||
var pathArray = url.pathname.split('/');
|
if (!fileId) {
|
||||||
var fileId = pathArray[4];
|
return;
|
||||||
|
}
|
||||||
var params = {
|
var params = {
|
||||||
fileId
|
fileId
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user