File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 134134 let cachedAt: string | null = null ;
135135 let didReceiveLibrary = false ;
136136 let didSelectGameManually = false ;
137+ let libraryScrollTop = 0 ;
138+ let lastActiveView: ViewMode = activeView ;
137139 let imageUrlsByPath: Record <string , string > = {};
138140 let pendingImages = new Map <number , PendingImage >();
139141 let objectUrls: string [] = [];
293295 requestThumbnailsForGames (visibleThumbnailGames );
294296 }
295297
298+ $ : {
299+ if (lastActiveView === " library" && activeView !== " library" ) {
300+ const container = document .querySelector (" .content" );
301+ if (container ) {
302+ libraryScrollTop = container .scrollTop ;
303+ }
304+ }
305+ lastActiveView = activeView ;
306+ }
307+
296308 $ : if (activeView === " detail" ) {
297309 selectedGameId ;
298310 void tick ().then (() => {
303315 });
304316 }
305317
318+ $ : if (activeView === " library" ) {
319+ void tick ().then (() => {
320+ const container = document .querySelector (" .content" );
321+ if (container ) {
322+ container .scrollTop = libraryScrollTop ;
323+ }
324+ });
325+ }
326+
306327 const isObject = (value : unknown ): value is Record <string , unknown > =>
307328 !! value && typeof value === " object" ;
308329
You can’t perform that action at this time.
0 commit comments