mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Use "private" close event for dialog helper race condition
This commit is contained in:
parent
54bafa5dcc
commit
c1739c4b7f
2 changed files with 8 additions and 5 deletions
|
@ -118,13 +118,18 @@ import '../../assets/css/scrollstyles.scss';
|
||||||
//resolve();
|
//resolve();
|
||||||
// if we just called history.back(), then use a timeout to allow the history events to fire first
|
// if we just called history.back(), then use a timeout to allow the history events to fire first
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
dlg.dispatchEvent(new CustomEvent('close', {
|
||||||
|
bubbles: false,
|
||||||
|
cancelable: false
|
||||||
|
}));
|
||||||
|
|
||||||
resolve({
|
resolve({
|
||||||
element: dlg
|
element: dlg
|
||||||
});
|
});
|
||||||
}, 1);
|
}, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
dlg.addEventListener('close', onDialogClosed);
|
dlg.addEventListener('_close', onDialogClosed);
|
||||||
|
|
||||||
const center = !dlg.classList.contains('dialog-fixedSize');
|
const center = !dlg.classList.contains('dialog-fixedSize');
|
||||||
if (center) {
|
if (center) {
|
||||||
|
@ -239,7 +244,7 @@ import '../../assets/css/scrollstyles.scss';
|
||||||
focusManager.popScope(dlg);
|
focusManager.popScope(dlg);
|
||||||
|
|
||||||
dlg.classList.add('hide');
|
dlg.classList.add('hide');
|
||||||
dlg.dispatchEvent(new CustomEvent('close', {
|
dlg.dispatchEvent(new CustomEvent('_close', {
|
||||||
bubbles: false,
|
bubbles: false,
|
||||||
cancelable: false
|
cancelable: false
|
||||||
}));
|
}));
|
||||||
|
|
|
@ -1087,9 +1087,7 @@ import template from './metadataEditor.template.html';
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
show: async function (itemId, serverId) {
|
show: function (itemId, serverId) {
|
||||||
const apiClient = ServerConnections.getApiClient(serverId);
|
|
||||||
await apiClient.getItem(apiClient.getCurrentUserId(), itemId);
|
|
||||||
return new Promise(resolve => show(itemId, serverId, resolve));
|
return new Promise(resolve => show(itemId, serverId, resolve));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue