mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-14 09:03:03 -04:00
fix
This commit is contained in:
parent
86d6fc60ab
commit
8268f70518
1 changed files with 8 additions and 4 deletions
|
@ -25,13 +25,12 @@ import definePlugin, { OptionType } from "@utils/types";
|
||||||
import style from "./index.css?managed";
|
import style from "./index.css?managed";
|
||||||
|
|
||||||
const API_URL = "https://usrbg.is-hardly.online/users";
|
const API_URL = "https://usrbg.is-hardly.online/users";
|
||||||
const cachebust = Date.now();
|
|
||||||
|
|
||||||
interface UsrbgApiReturn {
|
interface UsrbgApiReturn {
|
||||||
endpoint: string;
|
endpoint: string;
|
||||||
bucket: string;
|
bucket: string;
|
||||||
prefix: string;
|
prefix: string;
|
||||||
users: string[];
|
users: { [id: string]: string; };
|
||||||
}
|
}
|
||||||
|
|
||||||
const settings = definePluginSettings({
|
const settings = definePluginSettings({
|
||||||
|
@ -122,7 +121,7 @@ export default definePlugin({
|
||||||
|
|
||||||
userHasBackground(userId: string) {
|
userHasBackground(userId: string) {
|
||||||
if (this.data === null) return false;
|
if (this.data === null) return false;
|
||||||
return this.data.users.includes(userId);
|
return this.data.users[userId] !== undefined;
|
||||||
},
|
},
|
||||||
|
|
||||||
getImageUrl(userId: string): string | null {
|
getImageUrl(userId: string): string | null {
|
||||||
|
@ -130,8 +129,13 @@ export default definePlugin({
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const etag = this.data.users[userId];
|
||||||
|
if (etag === undefined) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const { endpoint, bucket, prefix } = this.data;
|
const { endpoint, bucket, prefix } = this.data;
|
||||||
return `${endpoint}/${bucket}/${prefix}${userId}?${cachebust}`;
|
return `${endpoint}/${bucket}/${prefix}${userId}?${etag}`;
|
||||||
},
|
},
|
||||||
|
|
||||||
async start() {
|
async start() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue