feat(myshares): new version of myshares sections, supporting grants Users + Tokens
This commit is contained in:
+21
-13
@@ -11,6 +11,7 @@ import { favorites } from '../features/library/favorites.js';
|
||||
import { musicView } from '../features/library/music.js';
|
||||
import { photosView } from '../features/library/photos.js';
|
||||
import { favoritesView } from '../views/favorites/favoritesView.js';
|
||||
import { mySharesView } from '../views/myShares/mySharesView.js';
|
||||
import { recentView } from '../views/recent/recentView.js';
|
||||
import { sharedView } from '../views/shared/sharedView.js';
|
||||
import { sharedWithMeView } from '../views/sharedWithMe/sharedWithMeView.js';
|
||||
@@ -165,9 +166,10 @@ function setCurrentSection(section) {
|
||||
appElements.pageTitle.setAttribute('data-i18n', titleKey);
|
||||
}
|
||||
|
||||
// Hide sharedView when switching to any other section
|
||||
if (section !== 'shared' && sharedView) {
|
||||
sharedView.hide();
|
||||
// Hide sharedView and mySharesView when switching to any other section
|
||||
if (section !== 'shared') {
|
||||
if (sharedView) sharedView.hide();
|
||||
mySharesView.hide();
|
||||
}
|
||||
|
||||
// Hide "Load more" button when leaving the sharedwithme section
|
||||
@@ -208,21 +210,27 @@ function switchToSharedSection() {
|
||||
const breadcrumb = document.querySelector('.breadcrumb');
|
||||
breadcrumb?.classList.add('hidden');
|
||||
|
||||
// Hide actions-bar for shared view
|
||||
setActionsBarMode('hidden');
|
||||
// Show actions-bar with group-by controls only (no grid/list toggle —
|
||||
// MySharesList is always in list mode).
|
||||
setActionsBarMode('shared');
|
||||
|
||||
//reset files view + remove any error
|
||||
ui.resetFilesList();
|
||||
// Populate the group-by dropdown with this section's dimensions.
|
||||
setGroupByView(mySharesView);
|
||||
syncGroupByMenu(mySharesView.groupByDefs);
|
||||
|
||||
// Hide file containers
|
||||
toggleFileContainer(false);
|
||||
// Restore the saved group-by selection in the dropdown.
|
||||
const msPrefs = viewPrefs.load('shared');
|
||||
applyGroupByMenuState(msPrefs.groupBy, msPrefs.reversed);
|
||||
|
||||
// Show shared view
|
||||
sharedView.init().then(() => {
|
||||
sharedView.show();
|
||||
});
|
||||
// Show the files container always in list view — grid is not applicable here.
|
||||
toggleFileContainer(true);
|
||||
app.currentView = 'list';
|
||||
syncViewContainers();
|
||||
|
||||
if (batchToolbar) batchToolbar.clear();
|
||||
|
||||
// Load and render items into the files container
|
||||
mySharesView.init();
|
||||
}
|
||||
|
||||
function switchToSharedWithMeSection() {
|
||||
|
||||
Reference in New Issue
Block a user