refactor queryRequest

This commit is contained in:
pa
2026-03-09 21:28:45 +09:00
parent c1a35223d4
commit 58b9bdc1c5
60 changed files with 1134 additions and 883 deletions

View File

@@ -14,7 +14,7 @@ import {
sanitizeEntityJson,
storeAvatarImage
} from '../shared/utils';
import { avatarRequest, miscRequest } from '../api';
import { avatarRequest, miscRequest, queryRequest } from '../api';
import { AppDebug } from '../service/appConfig';
import { database } from '../service/database';
import { patchAvatarFromEvent } from '../queries';
@@ -174,7 +174,7 @@ export const useAvatarStore = defineStore('Avatar', () => {
}
const loadAvatarRequest = forceRefresh
? avatarRequest.getAvatar({ avatarId })
: avatarRequest.getCachedAvatar({ avatarId });
: queryRequest.fetch('avatar', { avatarId });
loadAvatarRequest
.then((args) => {
const ref = applyAvatar(args.json);
@@ -312,6 +312,9 @@ export const useAvatarStore = defineStore('Avatar', () => {
return ref;
}
/**
*
*/
function resetCachedAvatarModerations() {
cachedAvatarModerations.clear();
}