1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Reorder dialogs array

This commit is contained in:
Bill Thornton 2022-05-10 14:23:08 -04:00
parent 466b0dd60c
commit 47d5b0eb2d

View file

@ -91,7 +91,7 @@ import '../../assets/css/scrollstyles.scss';
if (isHistoryEnabled(dlg)) {
const state = history.location.state || {};
if (state.dialogs?.length > 0) {
if (state.dialogs[0] === hash) {
if (state.dialogs[state.dialogs.length - 1] === hash) {
history.back();
} else if (state.dialogs.includes(hash)) {
console.info('[dialogHelper] dialog "%s" was closed, but is not the last dialog opened', hash);
@ -151,8 +151,8 @@ import '../../assets/css/scrollstyles.scss';
if (isHistoryEnabled(dlg)) {
const state = history.location.state || {};
const dialogs = state.dialogs || [];
// Add new dialog to start of array
dialogs.unshift(hash);
// Add new dialog to the list of open dialogs
dialogs.push(hash);
history.push(
`${history.location.pathname}${history.location.search}`,