File tree Expand file tree Collapse file tree 4 files changed +9
-14
lines changed
ts/WoltLabSuite/Core/Component/User
js/WoltLabSuite/Core/Component/User Expand file tree Collapse file tree 4 files changed +9
-14
lines changed Original file line number Diff line number Diff line change 1010import { promiseMutex } from "WoltLabSuite/Core/Helper/PromiseMutex" ;
1111import { wheneverFirstSeen } from "WoltLabSuite/Core/Helper/Selector" ;
1212import { dialogFactory } from "WoltLabSuite/Core/Component/Dialog" ;
13+ import { show as showNotification } from "WoltLabSuite/Core/Ui/Notification" ;
1314import UiCloseOverlay from "WoltLabSuite/Core/Ui/CloseOverlay" ;
1415
1516interface Result {
@@ -27,8 +28,8 @@ async function editAvatar(button: HTMLElement): Promise<void> {
2728 if ( avatarForm ) {
2829 // In the ACP, the form should not be reloaded after changing the avatar.
2930 avatarForm . querySelector < HTMLImageElement > ( "img.userAvatarImage" ) ! . src = result . avatar ;
31+ showNotification ( ) ;
3032 } else {
31- // TODO can we simple replace all avatar images?
3233 window . location . reload ( ) ;
3334 }
3435 }
Original file line number Diff line number Diff line change 1111use wcf \data \user \UserEditor ;
1212use wcf \data \user \UserProfileAction ;
1313use wcf \form \AbstractForm ;
14+ use wcf \system \cache \runtime \FileRuntimeCache ;
1415use wcf \system \cache \runtime \UserProfileRuntimeCache ;
1516use wcf \system \exception \IllegalLinkException ;
1617use wcf \system \exception \PermissionDeniedException ;
@@ -290,7 +291,7 @@ public function readData()
290291
291292 // get the avatar object
292293 if ($ this ->avatarType == 'custom ' && $ this ->user ->avatarFileID ) {
293- $ this ->userAvatar = new File ($ this ->user ->avatarFileID );
294+ $ this ->userAvatar = FileRuntimeCache:: getInstance ()-> getObject ($ this ->user ->avatarFileID );
294295 }
295296
296297 // get the user cover photo object
Original file line number Diff line number Diff line change 33namespace wcf \data \attachment ;
44
55use wcf \data \DatabaseObject ;
6+ use wcf \data \file \File ;
67use wcf \data \ILinkableObject ;
78use wcf \data \IThumbnailFile ;
8- use wcf \data \file \File ;
9- use wcf \data \file \thumbnail \FileThumbnailList ;
109use wcf \data \object \type \ObjectTypeCache ;
10+ use wcf \system \cache \runtime \FileRuntimeCache ;
1111use wcf \system \request \IRouteController ;
1212use wcf \system \request \LinkHandler ;
1313use wcf \system \WCF ;
@@ -375,14 +375,7 @@ public function getFile(): ?File
375375 }
376376
377377 if (!isset ($ this ->file )) {
378- $ this ->file = new File ($ fileID );
379-
380- $ thumbnailList = new FileThumbnailList ();
381- $ thumbnailList ->getConditionBuilder ()->add ("fileID = ? " , [$ this ->file ->fileID ]);
382- $ thumbnailList ->readObjects ();
383- foreach ($ thumbnailList as $ thumbnail ) {
384- $ this ->file ->addThumbnail ($ thumbnail );
385- }
378+ $ this ->file = FileRuntimeCache::getInstance ()->getObject ($ fileID );
386379 }
387380
388381 return $ this ->file ;
You can’t perform that action at this time.
0 commit comments