mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-24 01:39:06 +01:00
Donut check for updates with every request of an admin user, only check on admin index page...
This commit is contained in:
parent
2a68b8e51f
commit
c10ca1c333
@ -41,7 +41,7 @@ export default define(meta, paramDef, async (ps, user, token) => {
|
||||
userProfile.loggedInDates = [...userProfile.loggedInDates, today];
|
||||
}
|
||||
|
||||
return await Users.pack<true, true>(userProfile.user!, userProfile.user!, {
|
||||
return await Users.pack<true, true>(user.id, user, {
|
||||
detail: true,
|
||||
includeSecrets: isSecure,
|
||||
userProfile,
|
||||
|
@ -21,9 +21,13 @@ export default define(meta, paramDef, async () => {
|
||||
)
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
tag_name = data[0].tag_name;
|
||||
if (data.length > 0)
|
||||
tag_name = data[0].tag_name ?? undefined;
|
||||
});
|
||||
|
||||
if (!tag_name)
|
||||
throw new Error('Could not fetch latest release information. Please check manually if your release of TrashPoss is up to date.');
|
||||
|
||||
return {
|
||||
tag_name,
|
||||
};
|
||||
|
@ -83,8 +83,7 @@
|
||||
v-if="
|
||||
thereIsUnresolvedAbuseReport ||
|
||||
noMaintainerInformation ||
|
||||
noBotProtection ||
|
||||
updateAvailable
|
||||
noBotProtection
|
||||
"
|
||||
class="indicator"
|
||||
><i class="icon ph-circle ph-fill"></i>
|
||||
@ -148,7 +147,6 @@ import { defaultStore } from "@/store";
|
||||
import { i18n } from "@/i18n";
|
||||
import { instance } from "@/instance";
|
||||
import { version } from "@/config";
|
||||
import { isUpdateAvailable } from "@/scripts/is-update-available.js";
|
||||
|
||||
const isEmpty = (x: string | null) => x == null || x === "";
|
||||
|
||||
@ -184,7 +182,6 @@ let noBotProtection =
|
||||
!instance.enableHcaptcha &&
|
||||
!instance.enableRecaptcha;
|
||||
let thereIsUnresolvedAbuseReport = $ref(false);
|
||||
let updateAvailable = $ref(false);
|
||||
|
||||
if ($i?.isAdmin) {
|
||||
os.api("admin/abuse-user-reports", {
|
||||
@ -193,12 +190,6 @@ if ($i?.isAdmin) {
|
||||
}).then((reports) => {
|
||||
if (reports?.length > 0) thereIsUnresolvedAbuseReport = true;
|
||||
});
|
||||
|
||||
if (defaultStore.state.showAdminUpdates) {
|
||||
isUpdateAvailable().then(res => {
|
||||
updateAvailable = res;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function openAccountMenu(ev: MouseEvent) {
|
||||
|
Loading…
Reference in New Issue
Block a user